<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="common/css/sf.css" rel="stylesheet" type="text/css" />
<title>Norm: Normalization of STLC</title>
<link href="common/jquery-ui/jquery-ui.css" rel="stylesheet">
<script src="common/jquery-ui/external/jquery/jquery.js"></script>
<script src="common/jquery-ui/jquery-ui.js"></script>
<script src="common/toggleproofs.js"></script>
<link href="common/css/plf.css" rel="stylesheet" type="text/css"/>
</head>

<body>

<div id="page">

<div id="header">
<div id='logoinheader'><a href='https://softwarefoundations.cis.upenn.edu'>
<img src='common/media/image/sf_logo_sm.png' alt='Software Foundations Logo'></a></div>
<div class='booktitleinheader'><a href='index.html'>Volume 2: Programming Language Foundations</a></div>
<ul id='menu'>
   <li class='section_name'><a href='toc.html'>Table of Contents</a></li>
   <li class='section_name'><a href='coqindex.html'>Index</a></li>
   <li class='section_name'><a href='deps.html'>Roadmap</a></li>
</ul>
</div>

<div id="main">

<h1 class="libtitle">Norm<span class="subtitle">Normalization of STLC</span></h1>

<div class="code">
</div>

<div class="code">

<br/>
<span class="id" title="keyword">Set</span> <span class="id" title="var">Warnings</span> "-notation-overridden,-parsing".<br/>
<span class="id" title="keyword">From</span> <span class="id" title="var">Coq</span> <span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="http://coq.inria.fr/library//Coq.Lists.List.html#"><span class="id" title="library">Lists.List</span></a>.<br/>
<span class="id" title="keyword">From</span> <span class="id" title="var">Coq</span> <span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#"><span class="id" title="library">Strings.String</span></a>.<br/>
<span class="id" title="keyword">From</span> <span class="id" title="var">PLF</span> <span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <span class="id" title="library">Maps</span>.<br/>
<span class="id" title="keyword">From</span> <span class="id" title="var">PLF</span> <span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="Smallstep.html#"><span class="id" title="library">Smallstep</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Hint Constructors</span> <a class="idref" href="Norm.html#multi"><span class="id" title="inductive">multi</span></a> : <span class="id" title="var">core</span>.<br/><hr class='doublespaceincode'/>
<span class="comment">(*&nbsp;Chapter&nbsp;written&nbsp;and&nbsp;maintained&nbsp;by&nbsp;Andrew&nbsp;Tolmach&nbsp;*)</span><br/>
</div>

<div class="doc">
This optional chapter is based on chapter 12 of <i>Types and
    Programming Languages</i> (Pierce).  It may be useful to look at the
    two together, as that chapter includes explanations and informal
    proofs that are not repeated here.

<div class="paragraph"> </div>

    In this chapter, we consider another fundamental theoretical
    property of the simply typed lambda-calculus: the fact that the
    evaluation of a well-typed program is guaranteed to halt in a
    finite number of steps---i.e., every well-typed term is
    <i>normalizable</i>.

<div class="paragraph"> </div>

    Unlike the type-safety properties we have considered so far, the
    normalization property does not extend to full-blown programming
    languages, because these languages nearly always extend the simply
    typed lambda-calculus with constructs, such as general
    recursion (see the <a href="MoreStlc.html"><span class="inlineref">MoreStlc</span></a> chapter) or recursive types, that
    can be used to write nonterminating programs.  However, the issue
    of normalization reappears at the level of <i>types</i> when we
    consider the metatheory of polymorphic versions of the lambda
    calculus such as System F-omega: in this system, the language of
    types effectively contains a copy of the simply typed
    lambda-calculus, and the termination of the typechecking algorithm
    will hinge on the fact that a "normalization" operation on type
    expressions is guaranteed to terminate.

<div class="paragraph"> </div>

    Another reason for studying normalization proofs is that they are
    some of the most beautiful---and mind-blowing---mathematics to be
    found in the type theory literature, often (as here) involving the
    fundamental proof technique of <i>logical relations</i>.

<div class="paragraph"> </div>

    The calculus we shall consider here is the simply typed
    lambda-calculus over a single base type <span class="inlinecode"><span class="id" title="var">bool</span></span> and with
    pairs. We'll give most details of the development for the basic
    lambda-calculus terms treating <span class="inlinecode"><span class="id" title="var">bool</span></span> as an uninterpreted base
    type, and leave the extension to the boolean operators and pairs
    to the reader.  Even for the base calculus, normalization is not
    entirely trivial to prove, since each reduction of a term can
    duplicate redexes in subterms. 
<div class="paragraph"> </div>

<a id="lab450"></a><h4 class="section">Exercise: 2 stars, standard (norm_fail)</h4>
 Where do we fail if we attempt to prove normalization by a
    straightforward induction on the size of a well-typed term? 
</div>
<div class="code">

<br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/><hr class='doublespaceincode'/>
<span class="comment">(*&nbsp;Do&nbsp;not&nbsp;modify&nbsp;the&nbsp;following&nbsp;line:&nbsp;*)</span><br/>
<span class="id" title="keyword">Definition</span> <a id="manual_grade_for_norm_fail" class="idref" href="#manual_grade_for_norm_fail"><span class="id" title="definition">manual_grade_for_norm_fail</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#option"><span class="id" title="inductive">option</span></a> (<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nat"><span class="id" title="inductive">nat</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac<sub>4</sub>"><span class="id" title="notation">×</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a>) := <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#None"><span class="id" title="constructor">None</span></a>.<br/>
<font size=-2>&#9744;</font>
</div>

<div class="doc"> 
<div class="paragraph"> </div>

<a id="lab451"></a><h4 class="section">Exercise: 5 stars, standard, especially useful (norm)</h4>
 The best ways to understand an intricate proof like this is
    are (1) to help fill it in and (2) to extend it.  We've left out some
    parts of the following development, including some proofs of lemmas
    and the all the cases involving products and conditionals.  Fill them
    in. 
</div>
<div class="code">

<br/>
<span class="comment">(*&nbsp;Do&nbsp;not&nbsp;modify&nbsp;the&nbsp;following&nbsp;line:&nbsp;*)</span><br/>
<span class="id" title="keyword">Definition</span> <a id="manual_grade_for_norm" class="idref" href="#manual_grade_for_norm"><span class="id" title="definition">manual_grade_for_norm</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#option"><span class="id" title="inductive">option</span></a> (<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nat"><span class="id" title="inductive">nat</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac<sub>4</sub>"><span class="id" title="notation">×</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a>) := <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#None"><span class="id" title="constructor">None</span></a>.<br/>
<font size=-2>&#9744;</font>
</div>


<div class="doc">
<a id="lab452"></a><h1 class="section">Language</h1>

<div class="paragraph"> </div>

 We begin by repeating the relevant language definition, which is
    similar to those in the <a href="MoreStlc.html"><span class="inlineref">MoreStlc</span></a> chapter, plus supporting
    results including type preservation and step determinism.  (We
    won't need progress.)  You may just wish to skip down to the
    Normalization section... 
</div>

<div class="doc">
<a id="lab453"></a><h3 class="section">Syntax and Operational Semantics</h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Inductive</span> <a id="ty" class="idref" href="#ty"><span class="id" title="inductive">ty</span></a> : <span class="id" title="keyword">Type</span> :=<br/>
&nbsp;&nbsp;| <a id="Ty_Bool" class="idref" href="#Ty_Bool"><span class="id" title="constructor">Ty_Bool</span></a> : <a class="idref" href="Norm.html#ty:1"><span class="id" title="inductive">ty</span></a><br/>
&nbsp;&nbsp;| <a id="Ty_Arrow" class="idref" href="#Ty_Arrow"><span class="id" title="constructor">Ty_Arrow</span></a> : <a class="idref" href="Norm.html#ty:1"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#ty:1"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#ty:1"><span class="id" title="inductive">ty</span></a><br/>
&nbsp;&nbsp;| <a id="Ty_Prod" class="idref" href="#Ty_Prod"><span class="id" title="constructor">Ty_Prod</span></a>  : <a class="idref" href="Norm.html#ty:1"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#ty:1"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#ty:1"><span class="id" title="inductive">ty</span></a><br/>
.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Inductive</span> <a id="tm" class="idref" href="#tm"><span class="id" title="inductive">tm</span></a> : <span class="id" title="keyword">Type</span> :=<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;pure&nbsp;STLC&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="tm_var" class="idref" href="#tm_var"><span class="id" title="constructor">tm_var</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="tm_app" class="idref" href="#tm_app"><span class="id" title="constructor">tm_app</span></a> : <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="tm_abs" class="idref" href="#tm_abs"><span class="id" title="constructor">tm_abs</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#ty"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;booleans&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="tm_true" class="idref" href="#tm_true"><span class="id" title="constructor">tm_true</span></a> : <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="tm_false" class="idref" href="#tm_false"><span class="id" title="constructor">tm_false</span></a> : <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="tm_if" class="idref" href="#tm_if"><span class="id" title="constructor">tm_if</span></a> : <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;pairs&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="tm_pair" class="idref" href="#tm_pair"><span class="id" title="constructor">tm_pair</span></a> : <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="tm_fst" class="idref" href="#tm_fst"><span class="id" title="constructor">tm_fst</span></a> : <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a><br/>
&nbsp;&nbsp;| <a id="tm_snd" class="idref" href="#tm_snd"><span class="id" title="constructor">tm_snd</span></a> : <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#tm:3"><span class="id" title="inductive">tm</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="var">Declare</span> <span class="id" title="var">Custom</span> <span class="id" title="var">Entry</span> <span class="id" title="var">stlc</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Notation</span> <a id="96e24cc1b3765f349012b832d1dd22ad" class="idref" href="#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&quot;</span></a>&lt;{ e }&gt;" := <span class="id" title="var">e</span> (<span class="id" title="var">e</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99).<br/>
<span class="id" title="keyword">Notation</span> <a id="b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>" class="idref" href="#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">&quot;</span></a>( x )" := <span class="id" title="var">x</span> (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span>, <span class="id" title="var">x</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99).<br/>
<span class="id" title="keyword">Notation</span> <a id=":stlc::x" class="idref" href="#:stlc::x"><span class="id" title="notation">&quot;</span></a>x" := <span class="id" title="var">x</span> (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0, <span class="id" title="var">x</span> <span class="id" title="keyword">constr</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
<span class="id" title="keyword">Notation</span> <a id=":stlc::x_'-&gt;'_x" class="idref" href="#:stlc::x_'-&gt;'_x"><span class="id" title="notation">&quot;</span></a>S <span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span> T" := (<a class="idref" href="Norm.html#Ty_Arrow"><span class="id" title="constructor">Ty_Arrow</span></a> <span class="id" title="var">S</span> <span class="id" title="var">T</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 50, <span class="id" title="tactic">right</span> <span class="id" title="keyword">associativity</span>).<br/>
<span class="id" title="keyword">Notation</span> <a id=":stlc::x_x" class="idref" href="#:stlc::x_x"><span class="id" title="notation">&quot;</span></a>x y" := (<a class="idref" href="Norm.html#tm_app"><span class="id" title="constructor">tm_app</span></a> <span class="id" title="var">x</span> <span class="id" title="var">y</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 1, <span class="id" title="tactic">left</span> <span class="id" title="keyword">associativity</span>).<br/>
<span class="id" title="keyword">Notation</span> <a id="c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>" class="idref" href="#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">&quot;</span></a>\ x : t , y" :=<br/>
&nbsp;&nbsp;(<a class="idref" href="Norm.html#tm_abs"><span class="id" title="constructor">tm_abs</span></a> <span class="id" title="var">x</span> <span class="id" title="var">t</span> <span class="id" title="var">y</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 90, <span class="id" title="var">x</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">t</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">y</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">left</span> <span class="id" title="keyword">associativity</span>).<br/>
<span class="id" title="keyword">Coercion</span> <a class="idref" href="Norm.html#tm_var"><span class="id" title="constructor">tm_var</span></a> <a class="idref" href="Norm.html#tm_var"><span class="id" title="constructor">:</span></a> <a class="idref" href="Norm.html#tm_var"><span class="id" title="constructor">string</span></a> <a class="idref" href="Norm.html#tm_var"><span class="id" title="constructor">&gt;<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#tm_var"><span class="id" title="constructor">tm</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Notation</span> <a id="45164e50103cb4f5a6f30f892835b135" class="idref" href="#45164e50103cb4f5a6f30f892835b135"><span class="id" title="notation">&quot;</span></a>{ x }" := <span class="id" title="var">x</span> (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 1, <span class="id" title="var">x</span> <span class="id" title="keyword">constr</span>).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Notation</span> <a id=":stlc::'Bool'" class="idref" href="#:stlc::'Bool'"><span class="id" title="notation">&quot;</span></a>'Bool'" := <a class="idref" href="Norm.html#Ty_Bool"><span class="id" title="constructor">Ty_Bool</span></a> (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
<span class="id" title="keyword">Notation</span> <a id=":stlc::'if'_x_'then'_x_'else'_x" class="idref" href="#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">&quot;</span></a>'if' x 'then' y 'else' z" :=<br/>
&nbsp;&nbsp;(<a class="idref" href="Norm.html#tm_if"><span class="id" title="constructor">tm_if</span></a> <span class="id" title="var">x</span> <span class="id" title="var">y</span> <span class="id" title="var">z</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 89,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">x</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">y</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">z</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">left</span> <span class="id" title="keyword">associativity</span>).<br/>
<span class="id" title="keyword">Notation</span> <a id=":::'true'" class="idref" href="#:::'true'"><span class="id" title="notation">&quot;</span></a>'true'"  := <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#true"><span class="id" title="constructor">true</span></a> (<span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 1).<br/>
<span class="id" title="keyword">Notation</span> <a id=":stlc::'true'" class="idref" href="#:stlc::'true'"><span class="id" title="notation">&quot;</span></a>'true'"  := <a class="idref" href="Norm.html#tm_true"><span class="id" title="constructor">tm_true</span></a> (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
<span class="id" title="keyword">Notation</span> <a id=":::'false'" class="idref" href="#:::'false'"><span class="id" title="notation">&quot;</span></a>'false'"  := <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#false"><span class="id" title="constructor">false</span></a> (<span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 1).<br/>
<span class="id" title="keyword">Notation</span> <a id=":stlc::'false'" class="idref" href="#:stlc::'false'"><span class="id" title="notation">&quot;</span></a>'false'"  := <a class="idref" href="Norm.html#tm_false"><span class="id" title="constructor">tm_false</span></a> (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Notation</span> <a id="58c5958b1bbf365bea74423471b3a186" class="idref" href="#58c5958b1bbf365bea74423471b3a186"><span class="id" title="notation">&quot;</span></a>X * Y" :=<br/>
&nbsp;&nbsp;(<a class="idref" href="Norm.html#Ty_Prod"><span class="id" title="constructor">Ty_Prod</span></a> <span class="id" title="var">X</span> <span class="id" title="var">Y</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 2, <span class="id" title="var">X</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span>, <span class="id" title="var">Y</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
<span class="id" title="keyword">Notation</span> <a id="a24bf76db12c1706eca6a0959ec95576" class="idref" href="#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">&quot;</span></a>( x ',' y )" := (<a class="idref" href="Norm.html#tm_pair"><span class="id" title="constructor">tm_pair</span></a> <span class="id" title="var">x</span> <span class="id" title="var">y</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">x</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">y</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 99).<br/>
<span class="id" title="keyword">Notation</span> <a id=":stlc::x_'.fst'" class="idref" href="#:stlc::x_'.fst'"><span class="id" title="notation">&quot;</span></a>t '.fst'" := (<a class="idref" href="Norm.html#tm_fst"><span class="id" title="constructor">tm_fst</span></a> <span class="id" title="var">t</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
<span class="id" title="keyword">Notation</span> <a id=":stlc::x_'.snd'" class="idref" href="#:stlc::x_'.snd'"><span class="id" title="notation">&quot;</span></a>t '.snd'" := (<a class="idref" href="Norm.html#tm_snd"><span class="id" title="constructor">tm_snd</span></a> <span class="id" title="var">t</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/>
</div>

<div class="doc">
<a id="lab454"></a><h3 class="section">Substitution</h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Reserved Notation</span> &quot;'[' x ':=' s ']' t" (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 20, <span class="id" title="var">x</span> <span class="id" title="keyword">constr</span>).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Fixpoint</span> <a id="subst" class="idref" href="#subst"><span class="id" title="definition">subst</span></a> (<a id="x:5" class="idref" href="#x:5"><span class="id" title="binder">x</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a>) (<a id="s:6" class="idref" href="#s:6"><span class="id" title="binder">s</span></a> : <a class="idref" href="Norm.html#tm"><span class="id" title="inductive">tm</span></a>) (<a id="t:7" class="idref" href="#t:7"><span class="id" title="binder">t</span></a> : <a class="idref" href="Norm.html#tm"><span class="id" title="inductive">tm</span></a>) : <a class="idref" href="Norm.html#tm"><span class="id" title="inductive">tm</span></a> :=<br/>
&nbsp;&nbsp;<span class="id" title="keyword">match</span> <a class="idref" href="Norm.html#t:7"><span class="id" title="variable">t</span></a> <span class="id" title="keyword">with</span><br/>
&nbsp;&nbsp;| <a class="idref" href="Norm.html#tm_var"><span class="id" title="constructor">tm_var</span></a> <span class="id" title="var">y</span> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">if</span> <span class="id" title="definition">eqb_string</span> <a class="idref" href="Norm.html#x:5"><span class="id" title="variable">x</span></a> <span class="id" title="var">y</span> <span class="id" title="keyword">then</span> <a class="idref" href="Norm.html#s:6"><span class="id" title="variable">s</span></a> <span class="id" title="keyword">else</span> <a class="idref" href="Norm.html#t:7"><span class="id" title="variable">t</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">\</span></a> <span class="id" title="var">y</span> <a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">:</span></a> <span class="id" title="var">T</span><a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">,</span></a> <span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">if</span> <span class="id" title="definition">eqb_string</span> <a class="idref" href="Norm.html#x:5"><span class="id" title="variable">x</span></a> <span class="id" title="var">y</span> <span class="id" title="keyword">then</span> <a class="idref" href="Norm.html#t:7"><span class="id" title="variable">t</span></a> <span class="id" title="keyword">else</span> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">\</span></a><span class="id" title="var">y</span><a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">:</span></a><span class="id" title="var">T</span><a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><span class="id" title="var">t<sub>1</sub></span> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a><span class="id" title="var">t<sub>1</sub></span><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a><span class="id" title="var">t<sub>2</sub></span><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#:stlc::'true'"><span class="id" title="notation">true</span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#:stlc::'true'"><span class="id" title="notation">true</span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#:stlc::'false'"><span class="id" title="notation">false</span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#:stlc::'false'"><span class="id" title="notation">false</span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">if</span></a> <span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <span class="id" title="var">t<sub>2</sub></span> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <span class="id" title="var">t<sub>3</sub></span><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">if</span></a> <a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>1</sub></span><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>3</sub></span><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">(</span></a><span class="id" title="var">t<sub>1</sub></span><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">,</span></a> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">)</span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">(</span></a> <a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>1</sub></span><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>2</sub></span><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">)</span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><span class="id" title="var">t<sub>0</sub>.fst</span><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>0</sub></span><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a><a class="idref" href="Norm.html#:stlc::x_'.fst'"><span class="id" title="notation">.</span></a><a class="idref" href="Norm.html#:stlc::x_'.fst'"><span class="id" title="notation">fst</span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><span class="id" title="var">t<sub>0</sub>.snd</span><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:5"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#s:6"><span class="id" title="variable">s</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a> <span class="id" title="var">t<sub>0</sub></span><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a><a class="idref" href="Norm.html#:stlc::x_'.snd'"><span class="id" title="notation">.</span></a><a class="idref" href="Norm.html#:stlc::x_'.snd'"><span class="id" title="notation">snd</span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;<span class="id" title="keyword">end</span><br/>
<br/>
&nbsp;&nbsp;<span class="id" title="keyword">where</span> <a id="83dbd6b289334c93dbc0440277d51136" class="idref" href="#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">&quot;</span></a>'[' x ':=' s ']' t" := (<a class="idref" href="Norm.html#subst:8"><span class="id" title="definition">subst</span></a> <span class="id" title="var">x</span> <span class="id" title="var">s</span> <span class="id" title="var">t</span>) (<span class="id" title="tactic">in</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span>).<br/>
</div>

<div class="doc">
<a id="lab455"></a><h3 class="section">Reduction</h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Inductive</span> <a id="value" class="idref" href="#value"><span class="id" title="inductive">value</span></a> : <a class="idref" href="Norm.html#tm"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <span class="id" title="keyword">Prop</span> :=<br/>
&nbsp;&nbsp;| <a id="v_abs" class="idref" href="#v_abs"><span class="id" title="constructor">v_abs</span></a> : <span class="id" title="keyword">∀</span> <a id="x:12" class="idref" href="#x:12"><span class="id" title="binder">x</span></a> <a id="T<sub>2</sub>:13" class="idref" href="#T<sub>2</sub>:13"><span class="id" title="binder">T<sub>2</sub></span></a> <a id="t<sub>1</sub>:14" class="idref" href="#t<sub>1</sub>:14"><span class="id" title="binder">t<sub>1</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#x:12"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">:</span></a><a class="idref" href="Norm.html#T<sub>2</sub>:13"><span class="id" title="variable">T<sub>2</sub></span></a><a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:14"><span class="id" title="variable">t<sub>1</sub></span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="v_true" class="idref" href="#v_true"><span class="id" title="constructor">v_true</span></a> :<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#:stlc::'true'"><span class="id" title="notation">true</span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="v_false" class="idref" href="#v_false"><span class="id" title="constructor">v_false</span></a> :<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#:stlc::'false'"><span class="id" title="notation">false</span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="v_pair" class="idref" href="#v_pair"><span class="id" title="constructor">v_pair</span></a> : <span class="id" title="keyword">∀</span> <a id="v<sub>1</sub>:15" class="idref" href="#v<sub>1</sub>:15"><span class="id" title="binder">v<sub>1</sub></span></a> <a id="v<sub>2</sub>:16" class="idref" href="#v<sub>2</sub>:16"><span class="id" title="binder">v<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#v<sub>1</sub>:15"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#v<sub>2</sub>:16"><span class="id" title="variable">v<sub>2</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#value:10"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#v<sub>1</sub>:15"><span class="id" title="variable">v<sub>1</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#v<sub>2</sub>:16"><span class="id" title="variable">v<sub>2</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">)</span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Hint Constructors</span> <a class="idref" href="Norm.html#value"><span class="id" title="inductive">value</span></a> : <span class="id" title="var">core</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Reserved Notation</span> &quot;t '<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>' t'" (<span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 40).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Inductive</span> <a id="step" class="idref" href="#step"><span class="id" title="inductive">step</span></a> : <a class="idref" href="Norm.html#tm"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#tm"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <span class="id" title="keyword">Prop</span> :=<br/>
&nbsp;&nbsp;| <a id="ST_AppAbs" class="idref" href="#ST_AppAbs"><span class="id" title="constructor">ST_AppAbs</span></a> : <span class="id" title="keyword">∀</span> <a id="x:19" class="idref" href="#x:19"><span class="id" title="binder">x</span></a> <a id="T<sub>2</sub>:20" class="idref" href="#T<sub>2</sub>:20"><span class="id" title="binder">T<sub>2</sub></span></a> <a id="t<sub>1</sub>:21" class="idref" href="#t<sub>1</sub>:21"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="v<sub>2</sub>:22" class="idref" href="#v<sub>2</sub>:22"><span class="id" title="binder">v<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#value"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#v<sub>2</sub>:22"><span class="id" title="variable">v<sub>2</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#x:19"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">:</span></a><a class="idref" href="Norm.html#T<sub>2</sub>:20"><span class="id" title="variable">T<sub>2</sub></span></a><a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:21"><span class="id" title="variable">t<sub>1</sub></span></a><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#v<sub>2</sub>:22"><span class="id" title="variable">v<sub>2</sub></span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:19"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#v<sub>2</sub>:22"><span class="id" title="variable">v<sub>2</sub></span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a><a class="idref" href="Norm.html#t<sub>1</sub>:21"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="ST_App1" class="idref" href="#ST_App1"><span class="id" title="constructor">ST_App1</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>1</sub>:23" class="idref" href="#t<sub>1</sub>:23"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>1</sub>':24" class="idref" href="#t<sub>1</sub>':24"><span class="id" title="binder">t<sub>1</sub>'</span></a> <a id="t<sub>2</sub>:25" class="idref" href="#t<sub>2</sub>:25"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#t<sub>1</sub>:23"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#t<sub>1</sub>':24"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#t<sub>1</sub>:23"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:25"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#t<sub>1</sub>':24"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:25"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="ST_App2" class="idref" href="#ST_App2"><span class="id" title="constructor">ST_App2</span></a> : <span class="id" title="keyword">∀</span> <a id="v<sub>1</sub>:26" class="idref" href="#v<sub>1</sub>:26"><span class="id" title="binder">v<sub>1</sub></span></a> <a id="t<sub>2</sub>:27" class="idref" href="#t<sub>2</sub>:27"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="t<sub>2</sub>':28" class="idref" href="#t<sub>2</sub>':28"><span class="id" title="binder">t<sub>2</sub>'</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#value"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#v<sub>1</sub>:26"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#t<sub>2</sub>:27"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#t<sub>2</sub>':28"><span class="id" title="variable">t<sub>2</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#v<sub>1</sub>:26"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:27"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#v<sub>1</sub>:26"><span class="id" title="variable">v<sub>1</sub></span></a>  <a class="idref" href="Norm.html#t<sub>2</sub>':28"><span class="id" title="variable">t<sub>2</sub>'</span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="ST_IfTrue" class="idref" href="#ST_IfTrue"><span class="id" title="constructor">ST_IfTrue</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>1</sub>:29" class="idref" href="#t<sub>1</sub>:29"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:30" class="idref" href="#t<sub>2</sub>:30"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">if</span></a> <a class="idref" href="Norm.html#:stlc::'true'"><span class="id" title="notation">true</span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:29"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:30"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:29"><span class="id" title="variable">t<sub>1</sub></span></a><br/>
&nbsp;&nbsp;| <a id="ST_IfFalse" class="idref" href="#ST_IfFalse"><span class="id" title="constructor">ST_IfFalse</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>1</sub>:31" class="idref" href="#t<sub>1</sub>:31"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:32" class="idref" href="#t<sub>2</sub>:32"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">if</span></a> <a class="idref" href="Norm.html#:stlc::'false'"><span class="id" title="notation">false</span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:31"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:32"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:32"><span class="id" title="variable">t<sub>2</sub></span></a><br/>
&nbsp;&nbsp;| <a id="ST_If" class="idref" href="#ST_If"><span class="id" title="constructor">ST_If</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>1</sub>:33" class="idref" href="#t<sub>1</sub>:33"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>1</sub>':34" class="idref" href="#t<sub>1</sub>':34"><span class="id" title="binder">t<sub>1</sub>'</span></a> <a id="t<sub>2</sub>:35" class="idref" href="#t<sub>2</sub>:35"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="t<sub>3</sub>:36" class="idref" href="#t<sub>3</sub>:36"><span class="id" title="binder">t<sub>3</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#t<sub>1</sub>:33"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#t<sub>1</sub>':34"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">if</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:33"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:35"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="Norm.html#t<sub>3</sub>:36"><span class="id" title="variable">t<sub>3</sub></span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">if</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>':34"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:35"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="Norm.html#t<sub>3</sub>:36"><span class="id" title="variable">t<sub>3</sub></span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="ST_Pair1" class="idref" href="#ST_Pair1"><span class="id" title="constructor">ST_Pair1</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>1</sub>:37" class="idref" href="#t<sub>1</sub>:37"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>1</sub>':38" class="idref" href="#t<sub>1</sub>':38"><span class="id" title="binder">t<sub>1</sub>'</span></a> <a id="t<sub>2</sub>:39" class="idref" href="#t<sub>2</sub>:39"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#t<sub>1</sub>:37"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#t<sub>1</sub>':38"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#t<sub>1</sub>:37"><span class="id" title="variable">t<sub>1</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">,</span></a><a class="idref" href="Norm.html#t<sub>2</sub>:39"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#t<sub>1</sub>':38"><span class="id" title="variable">t<sub>1</sub>'</span></a> <a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:39"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="ST_Pair2" class="idref" href="#ST_Pair2"><span class="id" title="constructor">ST_Pair2</span></a> : <span class="id" title="keyword">∀</span> <a id="v<sub>1</sub>:40" class="idref" href="#v<sub>1</sub>:40"><span class="id" title="binder">v<sub>1</sub></span></a> <a id="t<sub>2</sub>:41" class="idref" href="#t<sub>2</sub>:41"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="t<sub>2</sub>':42" class="idref" href="#t<sub>2</sub>':42"><span class="id" title="binder">t<sub>2</sub>'</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#value"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#v<sub>1</sub>:40"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#t<sub>2</sub>:41"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#t<sub>2</sub>':42"><span class="id" title="variable">t<sub>2</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#v<sub>1</sub>:40"><span class="id" title="variable">v<sub>1</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:41"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a>  <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#v<sub>1</sub>:40"><span class="id" title="variable">v<sub>1</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>':42"><span class="id" title="variable">t<sub>2</sub>'</span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="ST_Fst1" class="idref" href="#ST_Fst1"><span class="id" title="constructor">ST_Fst1</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>0</sub>:43" class="idref" href="#t<sub>0</sub>:43"><span class="id" title="binder">t<sub>0</sub></span></a> <a id="t<sub>0</sub>':44" class="idref" href="#t<sub>0</sub>':44"><span class="id" title="binder">t<sub>0</sub>'</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#t<sub>0</sub>:43"><span class="id" title="variable">t<sub>0</sub></span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#t<sub>0</sub>':44"><span class="id" title="variable">t<sub>0</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#t<sub>0</sub>:43"><span class="id" title="variable">t<sub>0</sub>.fst</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#t<sub>0</sub>':44"><span class="id" title="variable">t<sub>0</sub>'.fst</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="ST_FstPair" class="idref" href="#ST_FstPair"><span class="id" title="constructor">ST_FstPair</span></a> : <span class="id" title="keyword">∀</span> <a id="v<sub>1</sub>:45" class="idref" href="#v<sub>1</sub>:45"><span class="id" title="binder">v<sub>1</sub></span></a> <a id="v<sub>2</sub>:46" class="idref" href="#v<sub>2</sub>:46"><span class="id" title="binder">v<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#value"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#v<sub>1</sub>:45"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#value"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#v<sub>2</sub>:46"><span class="id" title="variable">v<sub>2</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#v<sub>1</sub>:45"><span class="id" title="variable">v<sub>1</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">,</span></a><a class="idref" href="Norm.html#v<sub>2</sub>:46"><span class="id" title="variable">v<sub>2</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">)</span></a><a class="idref" href="Norm.html#:stlc::x_'.fst'"><span class="id" title="notation">.</span></a><a class="idref" href="Norm.html#:stlc::x_'.fst'"><span class="id" title="notation">fst</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#v<sub>1</sub>:45"><span class="id" title="variable">v<sub>1</sub></span></a><br/>
&nbsp;&nbsp;| <a id="ST_Snd1" class="idref" href="#ST_Snd1"><span class="id" title="constructor">ST_Snd1</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>0</sub>:47" class="idref" href="#t<sub>0</sub>:47"><span class="id" title="binder">t<sub>0</sub></span></a> <a id="t<sub>0</sub>':48" class="idref" href="#t<sub>0</sub>':48"><span class="id" title="binder">t<sub>0</sub>'</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#t<sub>0</sub>:47"><span class="id" title="variable">t<sub>0</sub></span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#t<sub>0</sub>':48"><span class="id" title="variable">t<sub>0</sub>'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#t<sub>0</sub>:47"><span class="id" title="variable">t<sub>0</sub>.snd</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#t<sub>0</sub>':48"><span class="id" title="variable">t<sub>0</sub>'.snd</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="ST_SndPair" class="idref" href="#ST_SndPair"><span class="id" title="constructor">ST_SndPair</span></a> : <span class="id" title="keyword">∀</span> <a id="v<sub>1</sub>:49" class="idref" href="#v<sub>1</sub>:49"><span class="id" title="binder">v<sub>1</sub></span></a> <a id="v<sub>2</sub>:50" class="idref" href="#v<sub>2</sub>:50"><span class="id" title="binder">v<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#value"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#v<sub>1</sub>:49"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#value"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#v<sub>2</sub>:50"><span class="id" title="variable">v<sub>2</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#v<sub>1</sub>:49"><span class="id" title="variable">v<sub>1</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">,</span></a><a class="idref" href="Norm.html#v<sub>2</sub>:50"><span class="id" title="variable">v<sub>2</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">)</span></a><a class="idref" href="Norm.html#:stlc::x_'.snd'"><span class="id" title="notation">.</span></a><a class="idref" href="Norm.html#:stlc::x_'.snd'"><span class="id" title="notation">snd</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#v<sub>2</sub>:50"><span class="id" title="variable">v<sub>2</sub></span></a><br/>
<br/>
<span class="id" title="keyword">where</span> <a id=":::x_'--&gt;'_x" class="idref" href="#:::x_'--&gt;'_x"><span class="id" title="notation">&quot;</span></a>t '<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>' t'" := (<a class="idref" href="Norm.html#step:18"><span class="id" title="inductive">step</span></a> <span class="id" title="var">t</span> <span class="id" title="var">t'</span>).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Hint Constructors</span> <a class="idref" href="Norm.html#step"><span class="id" title="inductive">step</span></a> : <span class="id" title="var">core</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Notation</span> <a id="multistep" class="idref" href="#multistep"><span class="id" title="abbreviation">multistep</span></a> := (<a class="idref" href="Smallstep.html#multi"><span class="id" title="inductive">multi</span></a> <a class="idref" href="Norm.html#step"><span class="id" title="inductive">step</span></a>).<br/>
<span class="id" title="keyword">Notation</span> <a id="a781e4b1e2c022f0326182a9bd099911" class="idref" href="#a781e4b1e2c022f0326182a9bd099911"><span class="id" title="notation">&quot;</span></a>t<sub>1</sub> '<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span>' t<sub>2</sub>" := (<a class="idref" href="Norm.html#multistep"><span class="id" title="abbreviation">multistep</span></a> <span class="id" title="var">t<sub>1</sub></span> <span class="id" title="var">t<sub>2</sub></span>) (<span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 40).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Notation</span> <a id="step_normal_form" class="idref" href="#step_normal_form"><span class="id" title="abbreviation">step_normal_form</span></a> := (<a class="idref" href="Smallstep.html#normal_form"><span class="id" title="definition">normal_form</span></a> <a class="idref" href="Norm.html#step"><span class="id" title="inductive">step</span></a>).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Lemma</span> <a id="value__normal" class="idref" href="#value__normal"><span class="id" title="lemma">value__normal</span></a> : <span class="id" title="keyword">∀</span> <a id="t:51" class="idref" href="#t:51"><span class="id" title="binder">t</span></a>, <a class="idref" href="Norm.html#value"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#t:51"><span class="id" title="variable">t</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#step_normal_form"><span class="id" title="abbreviation">step_normal_form</span></a> <a class="idref" href="Norm.html#t:51"><span class="id" title="variable">t</span></a>.<br/>
<div class="togglescript" id="proofcontrol1" onclick="toggleDisplay('proof1');toggleDisplay('proofcontrol1')"><span class="show"></span></div>
<div class="proofscript" id="proof1" onclick="toggleDisplay('proof1');toggleDisplay('proofcontrol1')">
<span class="id" title="keyword">Proof</span> <span class="id" title="keyword">with</span> <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">t</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">induction</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">intros</span> [<span class="id" title="var">t'</span> <span class="id" title="var">ST</span>]; <span class="id" title="tactic">inversion</span> <span class="id" title="var">ST</span>...<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>
</div>

<div class="doc">
<a id="lab456"></a><h3 class="section">Typing</h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Definition</span> <a id="context" class="idref" href="#context"><span class="id" title="definition">context</span></a> := <span class="id" title="definition">partial_map</span> <a class="idref" href="Norm.html#ty"><span class="id" title="inductive">ty</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Reserved Notation</span> &quot;Gamma '&#x22A2;' t '&#x2208;' T" (<span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 40,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">t</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span>, <span class="id" title="var">T</span> <span class="id" title="var">custom</span> <span class="id" title="var">stlc</span> <span class="id" title="tactic">at</span> <span class="id" title="keyword">level</span> 0).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Inductive</span> <a id="has_type" class="idref" href="#has_type"><span class="id" title="inductive">has_type</span></a> : <a class="idref" href="Norm.html#context"><span class="id" title="definition">context</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#tm"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#ty"><span class="id" title="inductive">ty</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <span class="id" title="keyword">Prop</span> :=<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;Same&nbsp;as&nbsp;before:&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;pure&nbsp;STLC&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="T_Var" class="idref" href="#T_Var"><span class="id" title="constructor">T_Var</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:54" class="idref" href="#Gamma:54"><span class="id" title="binder">Gamma</span></a> <a id="x:55" class="idref" href="#x:55"><span class="id" title="binder">x</span></a> <a id="T<sub>1</sub>:56" class="idref" href="#T<sub>1</sub>:56"><span class="id" title="binder">T<sub>1</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:54"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#x:55"><span class="id" title="variable">x</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#Some"><span class="id" title="constructor">Some</span></a> <a class="idref" href="Norm.html#T<sub>1</sub>:56"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:54"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#x:55"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T<sub>1</sub>:56"><span class="id" title="variable">T<sub>1</sub></span></a><br/>
&nbsp;&nbsp;| <a id="T_Abs" class="idref" href="#T_Abs"><span class="id" title="constructor">T_Abs</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:57" class="idref" href="#Gamma:57"><span class="id" title="binder">Gamma</span></a> <a id="x:58" class="idref" href="#x:58"><span class="id" title="binder">x</span></a> <a id="T<sub>1</sub>:59" class="idref" href="#T<sub>1</sub>:59"><span class="id" title="binder">T<sub>1</sub></span></a> <a id="T<sub>2</sub>:60" class="idref" href="#T<sub>2</sub>:60"><span class="id" title="binder">T<sub>2</sub></span></a> <a id="t<sub>1</sub>:61" class="idref" href="#t<sub>1</sub>:61"><span class="id" title="binder">t<sub>1</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#x:58"><span class="id" title="variable">x</span></a> <span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>&#x22A2;</span><span style='font-size:90%;'>&gt;</span></span></span></span></span> <a class="idref" href="Norm.html#T<sub>2</sub>:60"><span class="id" title="variable">T<sub>2</sub></span></a> <span class="id" title="notation">;</span> <a class="idref" href="Norm.html#Gamma:57"><span class="id" title="variable">Gamma</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:61"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T<sub>1</sub>:59"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:57"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#x:58"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">:</span></a><a class="idref" href="Norm.html#T<sub>2</sub>:60"><span class="id" title="variable">T<sub>2</sub></span></a><a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:61"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#T<sub>2</sub>:60"><span class="id" title="variable">T<sub>2</sub></span></a> <a class="idref" href="Norm.html#:stlc::x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#T<sub>1</sub>:59"><span class="id" title="variable">T<sub>1</sub></span></a><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a><br/>
&nbsp;&nbsp;| <a id="T_App" class="idref" href="#T_App"><span class="id" title="constructor">T_App</span></a> : <span class="id" title="keyword">∀</span> <a id="T<sub>1</sub>:62" class="idref" href="#T<sub>1</sub>:62"><span class="id" title="binder">T<sub>1</sub></span></a> <a id="T<sub>2</sub>:63" class="idref" href="#T<sub>2</sub>:63"><span class="id" title="binder">T<sub>2</sub></span></a> <a id="Gamma:64" class="idref" href="#Gamma:64"><span class="id" title="binder">Gamma</span></a> <a id="t<sub>1</sub>:65" class="idref" href="#t<sub>1</sub>:65"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:66" class="idref" href="#t<sub>2</sub>:66"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:64"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:65"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#T<sub>2</sub>:63"><span class="id" title="variable">T<sub>2</sub></span></a> <a class="idref" href="Norm.html#:stlc::x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#T<sub>1</sub>:62"><span class="id" title="variable">T<sub>1</sub></span></a><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:64"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:66"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T<sub>2</sub>:63"><span class="id" title="variable">T<sub>2</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:64"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:65"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:66"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T<sub>1</sub>:62"><span class="id" title="variable">T<sub>1</sub></span></a><br/>
&nbsp;&nbsp;| <a id="T_True" class="idref" href="#T_True"><span class="id" title="constructor">T_True</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:67" class="idref" href="#Gamma:67"><span class="id" title="binder">Gamma</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:67"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#:stlc::'true'"><span class="id" title="notation">true</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#:stlc::'Bool'"><span class="id" title="notation">Bool</span></a><br/>
&nbsp;&nbsp;| <a id="T_False" class="idref" href="#T_False"><span class="id" title="constructor">T_False</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:68" class="idref" href="#Gamma:68"><span class="id" title="binder">Gamma</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:68"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#:stlc::'false'"><span class="id" title="notation">false</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#:stlc::'Bool'"><span class="id" title="notation">Bool</span></a><br/>
&nbsp;&nbsp;| <a id="T_If" class="idref" href="#T_If"><span class="id" title="constructor">T_If</span></a> : <span class="id" title="keyword">∀</span> <a id="t<sub>1</sub>:69" class="idref" href="#t<sub>1</sub>:69"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:70" class="idref" href="#t<sub>2</sub>:70"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="t<sub>3</sub>:71" class="idref" href="#t<sub>3</sub>:71"><span class="id" title="binder">t<sub>3</sub></span></a> <a id="T<sub>1</sub>:72" class="idref" href="#T<sub>1</sub>:72"><span class="id" title="binder">T<sub>1</sub></span></a> <a id="Gamma:73" class="idref" href="#Gamma:73"><span class="id" title="binder">Gamma</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:73"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:69"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#:stlc::'Bool'"><span class="id" title="notation">Bool</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:73"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:70"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T<sub>1</sub>:72"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:73"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t<sub>3</sub>:71"><span class="id" title="variable">t<sub>3</sub></span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T<sub>1</sub>:72"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:73"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">if</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:69"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:70"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="Norm.html#t<sub>3</sub>:71"><span class="id" title="variable">t<sub>3</sub></span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T<sub>1</sub>:72"><span class="id" title="variable">T<sub>1</sub></span></a><br/>
&nbsp;&nbsp;| <a id="T_Pair" class="idref" href="#T_Pair"><span class="id" title="constructor">T_Pair</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:74" class="idref" href="#Gamma:74"><span class="id" title="binder">Gamma</span></a> <a id="t<sub>1</sub>:75" class="idref" href="#t<sub>1</sub>:75"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:76" class="idref" href="#t<sub>2</sub>:76"><span class="id" title="binder">t<sub>2</sub></span></a> <a id="T<sub>1</sub>:77" class="idref" href="#T<sub>1</sub>:77"><span class="id" title="binder">T<sub>1</sub></span></a> <a id="T<sub>2</sub>:78" class="idref" href="#T<sub>2</sub>:78"><span class="id" title="binder">T<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:74"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:75"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T<sub>1</sub>:77"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:74"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:76"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T<sub>2</sub>:78"><span class="id" title="variable">T<sub>2</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:74"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#t<sub>1</sub>:75"><span class="id" title="variable">t<sub>1</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:76"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#T<sub>1</sub>:77"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="Norm.html#58c5958b1bbf365bea74423471b3a186"><span class="id" title="notation">×</span></a> <a class="idref" href="Norm.html#T<sub>2</sub>:78"><span class="id" title="variable">T<sub>2</sub></span></a><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a><br/>
&nbsp;&nbsp;| <a id="T_Fst" class="idref" href="#T_Fst"><span class="id" title="constructor">T_Fst</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:79" class="idref" href="#Gamma:79"><span class="id" title="binder">Gamma</span></a> <a id="t<sub>0</sub>:80" class="idref" href="#t<sub>0</sub>:80"><span class="id" title="binder">t<sub>0</sub></span></a> <a id="T<sub>1</sub>:81" class="idref" href="#T<sub>1</sub>:81"><span class="id" title="binder">T<sub>1</sub></span></a> <a id="T<sub>2</sub>:82" class="idref" href="#T<sub>2</sub>:82"><span class="id" title="binder">T<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:79"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t<sub>0</sub>:80"><span class="id" title="variable">t<sub>0</sub></span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#T<sub>1</sub>:81"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="Norm.html#58c5958b1bbf365bea74423471b3a186"><span class="id" title="notation">×</span></a> <a class="idref" href="Norm.html#T<sub>2</sub>:82"><span class="id" title="variable">T<sub>2</sub></span></a><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:79"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t<sub>0</sub>:80"><span class="id" title="variable">t<sub>0</sub>.fst</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T<sub>1</sub>:81"><span class="id" title="variable">T<sub>1</sub></span></a><br/>
&nbsp;&nbsp;| <a id="T_Snd" class="idref" href="#T_Snd"><span class="id" title="constructor">T_Snd</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:83" class="idref" href="#Gamma:83"><span class="id" title="binder">Gamma</span></a> <a id="t<sub>0</sub>:84" class="idref" href="#t<sub>0</sub>:84"><span class="id" title="binder">t<sub>0</sub></span></a> <a id="T<sub>1</sub>:85" class="idref" href="#T<sub>1</sub>:85"><span class="id" title="binder">T<sub>1</sub></span></a> <a id="T<sub>2</sub>:86" class="idref" href="#T<sub>2</sub>:86"><span class="id" title="binder">T<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:83"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t<sub>0</sub>:84"><span class="id" title="variable">t<sub>0</sub></span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#T<sub>1</sub>:85"><span class="id" title="variable">T<sub>1</sub></span></a> <a class="idref" href="Norm.html#58c5958b1bbf365bea74423471b3a186"><span class="id" title="notation">×</span></a> <a class="idref" href="Norm.html#T<sub>2</sub>:86"><span class="id" title="variable">T<sub>2</sub></span></a><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:83"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t<sub>0</sub>:84"><span class="id" title="variable">t<sub>0</sub>.snd</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T<sub>2</sub>:86"><span class="id" title="variable">T<sub>2</sub></span></a><br/>
<br/>
<span class="id" title="keyword">where</span> <a id="3b5796de2387691122e67a3516cd710b" class="idref" href="#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&quot;</span></a>Gamma '&#x22A2;' t '&#x2208;' T" := (<a class="idref" href="Norm.html#has_type:53"><span class="id" title="inductive">has_type</span></a> <span class="id" title="var">Gamma</span> <span class="id" title="var">t</span> <span class="id" title="var">T</span>).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Hint Constructors</span> <a class="idref" href="Norm.html#has_type"><span class="id" title="inductive">has_type</span></a> : <span class="id" title="var">core</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Hint Extern</span> 2 (<a class="idref" href="Norm.html#has_type"><span class="id" title="inductive">has_type</span></a> <span class="id" title="var">_</span> (<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#app"><span class="id" title="definition">app</span></a> <span class="id" title="var">_</span> <span class="id" title="var">_</span>) <span class="id" title="var">_</span>) ⇒ <span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#T_App"><span class="id" title="constructor">T_App</span></a>; <span class="id" title="tactic">auto</span> : <span class="id" title="var">core</span>.<br/>
<span class="id" title="keyword">Hint Extern</span> 2 (<span class="id" title="var">_</span> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <span class="id" title="var">_</span>) ⇒ <span class="id" title="tactic">compute</span>; <span class="id" title="tactic">reflexivity</span> : <span class="id" title="var">core</span>.<br/>
</div>

<div class="doc">
<a id="lab457"></a><h2 class="section">Weakening</h2>

<div class="paragraph"> </div>

 The weakening lemma is proved as in pure STLC. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="weakening" class="idref" href="#weakening"><span class="id" title="lemma">weakening</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:87" class="idref" href="#Gamma:87"><span class="id" title="binder">Gamma</span></a> <a id="Gamma':88" class="idref" href="#Gamma':88"><span class="id" title="binder">Gamma'</span></a> <a id="t:89" class="idref" href="#t:89"><span class="id" title="binder">t</span></a> <a id="T:90" class="idref" href="#T:90"><span class="id" title="binder">T</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="definition">inclusion</span> <a class="idref" href="Norm.html#Gamma:87"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#Gamma':88"><span class="id" title="variable">Gamma'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:87"><span class="id" title="variable">Gamma</span></a>  <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:89"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T:90"><span class="id" title="variable">T</span></a>  <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma':88"><span class="id" title="variable">Gamma'</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:89"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T:90"><span class="id" title="variable">T</span></a>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">Gamma</span> <span class="id" title="var">Gamma'</span> <span class="id" title="var">t</span> <span class="id" title="var">T</span> <span class="id" title="var">H</span> <span class="id" title="var">Ht</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">generalize</span> <span class="id" title="tactic">dependent</span> <span class="id" title="var">Gamma'</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">Ht</span>; <span class="id" title="tactic">eauto</span> <span class="id" title="keyword">using</span> <span class="id" title="lemma">inclusion_update</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Lemma</span> <a id="weakening_empty" class="idref" href="#weakening_empty"><span class="id" title="lemma">weakening_empty</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:91" class="idref" href="#Gamma:91"><span class="id" title="binder">Gamma</span></a> <a id="t:92" class="idref" href="#t:92"><span class="id" title="binder">t</span></a> <a id="T:93" class="idref" href="#T:93"><span class="id" title="binder">T</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:92"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T:93"><span class="id" title="variable">T</span></a>  <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:91"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:92"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T:93"><span class="id" title="variable">T</span></a>.<br/>
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">Gamma</span> <span class="id" title="var">t</span> <span class="id" title="var">T</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#weakening"><span class="id" title="lemma">weakening</span></a>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">discriminate</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<div class="doc">
<a id="lab458"></a><h3 class="section">Substitution</h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="substitution_preserves_typing" class="idref" href="#substitution_preserves_typing"><span class="id" title="lemma">substitution_preserves_typing</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:94" class="idref" href="#Gamma:94"><span class="id" title="binder">Gamma</span></a> <a id="x:95" class="idref" href="#x:95"><span class="id" title="binder">x</span></a> <a id="U:96" class="idref" href="#U:96"><span class="id" title="binder">U</span></a> <a id="t:97" class="idref" href="#t:97"><span class="id" title="binder">t</span></a> <a id="v:98" class="idref" href="#v:98"><span class="id" title="binder">v</span></a> <a id="T:99" class="idref" href="#T:99"><span class="id" title="binder">T</span></a>,<br/>
&nbsp;&nbsp;<a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#x:95"><span class="id" title="variable">x</span></a> <span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>&#x22A2;</span><span style='font-size:90%;'>&gt;</span></span></span></span></span> <a class="idref" href="Norm.html#U:96"><span class="id" title="variable">U</span></a> <span class="id" title="notation">;</span> <a class="idref" href="Norm.html#Gamma:94"><span class="id" title="variable">Gamma</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:97"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T:99"><span class="id" title="variable">T</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#v:98"><span class="id" title="variable">v</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#U:96"><span class="id" title="variable">U</span></a>   <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:94"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:95"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#v:98"><span class="id" title="variable">v</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a><a class="idref" href="Norm.html#t:97"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T:99"><span class="id" title="variable">T</span></a>.<br/>
<span class="id" title="keyword">Proof</span> <span class="id" title="keyword">with</span> <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">Gamma</span> <span class="id" title="var">x</span> <span class="id" title="var">U</span> <span class="id" title="var">t</span> <span class="id" title="var">v</span> <span class="id" title="var">T</span> <span class="id" title="var">Ht</span> <span class="id" title="var">Hv</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">generalize</span> <span class="id" title="tactic">dependent</span> <span class="id" title="var">Gamma</span>. <span class="id" title="tactic">generalize</span> <span class="id" title="tactic">dependent</span> <span class="id" title="var">T</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">t</span>; <span class="id" title="tactic">intros</span> <span class="id" title="var">T</span> <span class="id" title="var">Gamma</span> <span class="id" title="var">H</span>;<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;in&nbsp;each&nbsp;case,&nbsp;we'll&nbsp;want&nbsp;to&nbsp;get&nbsp;at&nbsp;the&nbsp;derivation&nbsp;of&nbsp;H&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">clear</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">subst</span>; <span class="id" title="tactic">simpl</span>; <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;var&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rename</span> <span class="id" title="var">s</span> <span class="id" title="var">into</span> <span class="id" title="var">y</span>. <span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">x</span> <span class="id" title="var">y</span>); <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;x=y&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_eq</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>2</sub></span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">injection</span> <span class="id" title="var">H<sub>2</sub></span> <span class="id" title="keyword">as</span> <span class="id" title="var">H<sub>2</sub></span>; <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#weakening_empty"><span class="id" title="lemma">weakening_empty</span></a>. <span class="id" title="tactic">assumption</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;x&lt;&gt;y&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#T_Var"><span class="id" title="constructor">T_Var</span></a>. <span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_neq</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>2</sub></span>; <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;abs&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rename</span> <span class="id" title="var">s</span> <span class="id" title="var">into</span> <span class="id" title="var">y</span>, <span class="id" title="var">t</span> <span class="id" title="var">into</span> <span class="id" title="var">S</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">x</span> <span class="id" title="var">y</span>); <span class="id" title="tactic">subst</span>; <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#T_Abs"><span class="id" title="constructor">T_Abs</span></a>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;x=y&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_shadow</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>5</sub></span>. <span class="id" title="tactic">assumption</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="comment">(*&nbsp;x&lt;&gt;y&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <span class="id" title="var">IHt</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_permute</span>; <span class="id" title="tactic">auto</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<div class="doc">
<a id="lab459"></a><h3 class="section">Preservation</h3>

</div>
<div class="code">

<br/>
&nbsp;<span class="id" title="keyword">Theorem</span> <a id="preservation" class="idref" href="#preservation"><span class="id" title="lemma">preservation</span></a> : <span class="id" title="keyword">∀</span> <a id="t:100" class="idref" href="#t:100"><span class="id" title="binder">t</span></a> <a id="t':101" class="idref" href="#t':101"><span class="id" title="binder">t'</span></a> <a id="T:102" class="idref" href="#T:102"><span class="id" title="binder">T</span></a>,<br/>
&nbsp;&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:100"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T:102"><span class="id" title="variable">T</span></a>  <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#t:100"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#t':101"><span class="id" title="variable">t'</span></a>  <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t':101"><span class="id" title="variable">t'</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T:102"><span class="id" title="variable">T</span></a>.<br/>
<span class="id" title="keyword">Proof</span> <span class="id" title="keyword">with</span> <span class="id" title="tactic">eauto</span>.<br/>
<span class="id" title="tactic">intros</span> <span class="id" title="var">t</span> <span class="id" title="var">t'</span> <span class="id" title="var">T</span> <span class="id" title="var">HT</span>. <span class="id" title="tactic">generalize</span> <span class="id" title="tactic">dependent</span> <span class="id" title="var">t'</span>.<br/>
<span class="id" title="var">remember</span> <span class="id" title="definition">empty</span> <span class="id" title="keyword">as</span> <span class="id" title="var">Gamma</span>.<br/>
<span class="id" title="tactic">induction</span> <span class="id" title="var">HT</span>;<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">t'</span> <span class="id" title="var">HE</span>; <span class="id" title="tactic">subst</span>; <span class="id" title="tactic">inversion</span> <span class="id" title="var">HE</span>; <span class="id" title="tactic">subst</span>...<br/>
- <span class="comment">(*&nbsp;T_App&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">HE</span>; <span class="id" title="tactic">subst</span>...<br/>
&nbsp;&nbsp;+ <span class="comment">(*&nbsp;ST_AppAbs&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#substitution_preserves_typing"><span class="id" title="lemma">substitution_preserves_typing</span></a> <span class="id" title="keyword">with</span> <span class="id" title="var">T<sub>2</sub></span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">HT<sub>1</sub></span>...<br/>
- <span class="comment">(*&nbsp;T_Fst&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">HT</span>...<br/>
- <span class="comment">(*&nbsp;T_Snd&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">HT</span>...<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<div class="doc">
<a id="lab460"></a><h3 class="section">Context Invariance</h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Inductive</span> <a id="appears_free_in" class="idref" href="#appears_free_in"><span class="id" title="inductive">appears_free_in</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#tm"><span class="id" title="inductive">tm</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <span class="id" title="keyword">Prop</span> :=<br/>
&nbsp;&nbsp;| <a id="afi_var" class="idref" href="#afi_var"><span class="id" title="constructor">afi_var</span></a> : <span class="id" title="keyword">∀</span> (<a id="x:105" class="idref" href="#x:105"><span class="id" title="binder">x</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a>),<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:105"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#x:105"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="afi_app1" class="idref" href="#afi_app1"><span class="id" title="constructor">afi_app1</span></a> : <span class="id" title="keyword">∀</span> <a id="x:106" class="idref" href="#x:106"><span class="id" title="binder">x</span></a> <a id="t<sub>1</sub>:107" class="idref" href="#t<sub>1</sub>:107"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:108" class="idref" href="#t<sub>2</sub>:108"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:106"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:107"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:106"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:107"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:108"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="afi_app2" class="idref" href="#afi_app2"><span class="id" title="constructor">afi_app2</span></a> : <span class="id" title="keyword">∀</span> <a id="x:109" class="idref" href="#x:109"><span class="id" title="binder">x</span></a> <a id="t<sub>1</sub>:110" class="idref" href="#t<sub>1</sub>:110"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:111" class="idref" href="#t<sub>2</sub>:111"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:109"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:111"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:109"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:110"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:111"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="afi_abs" class="idref" href="#afi_abs"><span class="id" title="constructor">afi_abs</span></a> : <span class="id" title="keyword">∀</span> <a id="x:112" class="idref" href="#x:112"><span class="id" title="binder">x</span></a> <a id="y:113" class="idref" href="#y:113"><span class="id" title="binder">y</span></a> <a id="T<sub>11</sub>:114" class="idref" href="#T<sub>11</sub>:114"><span class="id" title="binder">T<sub>11</sub></span></a> <a id="t<sub>12</sub>:115" class="idref" href="#t<sub>12</sub>:115"><span class="id" title="binder">t<sub>12</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#y:113"><span class="id" title="variable">y</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'&lt;&gt;'_x"><span class="id" title="notation">≠</span></a> <a class="idref" href="Norm.html#x:112"><span class="id" title="variable">x</span></a>  <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:112"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#t<sub>12</sub>:115"><span class="id" title="variable">t<sub>12</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:112"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#y:113"><span class="id" title="variable">y</span></a> <a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">:</span></a> <a class="idref" href="Norm.html#T<sub>11</sub>:114"><span class="id" title="variable">T<sub>11</sub></span></a><a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#t<sub>12</sub>:115"><span class="id" title="variable">t<sub>12</sub></span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;booleans&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="afi_test0" class="idref" href="#afi_test0"><span class="id" title="constructor">afi_test0</span></a> : <span class="id" title="keyword">∀</span> <a id="x:116" class="idref" href="#x:116"><span class="id" title="binder">x</span></a> <a id="t<sub>0</sub>:117" class="idref" href="#t<sub>0</sub>:117"><span class="id" title="binder">t<sub>0</sub></span></a> <a id="t<sub>1</sub>:118" class="idref" href="#t<sub>1</sub>:118"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:119" class="idref" href="#t<sub>2</sub>:119"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:116"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#t<sub>0</sub>:117"><span class="id" title="variable">t<sub>0</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:116"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">if</span></a> <a class="idref" href="Norm.html#t<sub>0</sub>:117"><span class="id" title="variable">t<sub>0</sub></span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:118"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:119"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="afi_test1" class="idref" href="#afi_test1"><span class="id" title="constructor">afi_test1</span></a> : <span class="id" title="keyword">∀</span> <a id="x:120" class="idref" href="#x:120"><span class="id" title="binder">x</span></a> <a id="t<sub>0</sub>:121" class="idref" href="#t<sub>0</sub>:121"><span class="id" title="binder">t<sub>0</sub></span></a> <a id="t<sub>1</sub>:122" class="idref" href="#t<sub>1</sub>:122"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:123" class="idref" href="#t<sub>2</sub>:123"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:120"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:122"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:120"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">if</span></a> <a class="idref" href="Norm.html#t<sub>0</sub>:121"><span class="id" title="variable">t<sub>0</sub></span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:122"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:123"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="afi_test2" class="idref" href="#afi_test2"><span class="id" title="constructor">afi_test2</span></a> : <span class="id" title="keyword">∀</span> <a id="x:124" class="idref" href="#x:124"><span class="id" title="binder">x</span></a> <a id="t<sub>0</sub>:125" class="idref" href="#t<sub>0</sub>:125"><span class="id" title="binder">t<sub>0</sub></span></a> <a id="t<sub>1</sub>:126" class="idref" href="#t<sub>1</sub>:126"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:127" class="idref" href="#t<sub>2</sub>:127"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:124"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:127"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:124"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">if</span></a> <a class="idref" href="Norm.html#t<sub>0</sub>:125"><span class="id" title="variable">t<sub>0</sub></span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">then</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:126"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#:stlc::'if'_x_'then'_x_'else'_x"><span class="id" title="notation">else</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:127"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;pairs&nbsp;*)</span><br/>
&nbsp;&nbsp;| <a id="afi_pair1" class="idref" href="#afi_pair1"><span class="id" title="constructor">afi_pair1</span></a> : <span class="id" title="keyword">∀</span> <a id="x:128" class="idref" href="#x:128"><span class="id" title="binder">x</span></a> <a id="t<sub>1</sub>:129" class="idref" href="#t<sub>1</sub>:129"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:130" class="idref" href="#t<sub>2</sub>:130"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:128"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:129"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:128"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#t<sub>1</sub>:129"><span class="id" title="variable">t<sub>1</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:130"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="afi_pair2" class="idref" href="#afi_pair2"><span class="id" title="constructor">afi_pair2</span></a> : <span class="id" title="keyword">∀</span> <a id="x:131" class="idref" href="#x:131"><span class="id" title="binder">x</span></a> <a id="t<sub>1</sub>:132" class="idref" href="#t<sub>1</sub>:132"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:133" class="idref" href="#t<sub>2</sub>:133"><span class="id" title="binder">t<sub>2</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:131"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:133"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:131"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#t<sub>1</sub>:132"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:133"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="Norm.html#a24bf76db12c1706eca6a0959ec95576"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="afi_fst" class="idref" href="#afi_fst"><span class="id" title="constructor">afi_fst</span></a> : <span class="id" title="keyword">∀</span> <a id="x:134" class="idref" href="#x:134"><span class="id" title="binder">x</span></a> <a id="t:135" class="idref" href="#t:135"><span class="id" title="binder">t</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:134"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#t:135"><span class="id" title="variable">t</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:134"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#t:135"><span class="id" title="variable">t.fst</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
&nbsp;&nbsp;| <a id="afi_snd" class="idref" href="#afi_snd"><span class="id" title="constructor">afi_snd</span></a> : <span class="id" title="keyword">∀</span> <a id="x:136" class="idref" href="#x:136"><span class="id" title="binder">x</span></a> <a id="t:137" class="idref" href="#t:137"><span class="id" title="binder">t</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:136"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#t:137"><span class="id" title="variable">t</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in:103"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:136"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#t:137"><span class="id" title="variable">t.snd</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Hint Constructors</span> <a class="idref" href="Norm.html#appears_free_in"><span class="id" title="inductive">appears_free_in</span></a> : <span class="id" title="var">core</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Definition</span> <a id="closed" class="idref" href="#closed"><span class="id" title="definition">closed</span></a> (<a id="t:138" class="idref" href="#t:138"><span class="id" title="binder">t</span></a>:<a class="idref" href="Norm.html#tm"><span class="id" title="inductive">tm</span></a>) :=<br/>
&nbsp;&nbsp;<span class="id" title="keyword">∀</span> <a id="x:139" class="idref" href="#x:139"><span class="id" title="binder">x</span></a>, <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#63a68285c81db8f9bc456233bb9ed181"><span class="id" title="notation">¬</span></a> <a class="idref" href="Norm.html#appears_free_in"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:139"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#t:138"><span class="id" title="variable">t</span></a>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Lemma</span> <a id="context_invariance" class="idref" href="#context_invariance"><span class="id" title="lemma">context_invariance</span></a> : <span class="id" title="keyword">∀</span> <a id="Gamma:140" class="idref" href="#Gamma:140"><span class="id" title="binder">Gamma</span></a> <a id="Gamma':141" class="idref" href="#Gamma':141"><span class="id" title="binder">Gamma'</span></a> <a id="t:142" class="idref" href="#t:142"><span class="id" title="binder">t</span></a> <a id="S:143" class="idref" href="#S:143"><span class="id" title="binder">S</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:140"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:142"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#S:143"><span class="id" title="variable">S</span></a>  <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">(</span></a><span class="id" title="keyword">∀</span> <a id="x:144" class="idref" href="#x:144"><span class="id" title="binder">x</span></a>, <a class="idref" href="Norm.html#appears_free_in"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:144"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#t:142"><span class="id" title="variable">t</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#Gamma:140"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#x:144"><span class="id" title="variable">x</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="Norm.html#Gamma':141"><span class="id" title="variable">Gamma'</span></a> <a class="idref" href="Norm.html#x:144"><span class="id" title="variable">x</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">)</span></a>  <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma':141"><span class="id" title="variable">Gamma'</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:142"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#S:143"><span class="id" title="variable">S</span></a>.<br/>
<div class="togglescript" id="proofcontrol2" onclick="toggleDisplay('proof2');toggleDisplay('proofcontrol2')"><span class="show"></span></div>
<div class="proofscript" id="proof2" onclick="toggleDisplay('proof2');toggleDisplay('proofcontrol2')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">generalize</span> <span class="id" title="tactic">dependent</span> <span class="id" title="var">Gamma'</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">intros</span>; <span class="id" title="tactic">eauto</span> 12.<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Var&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#T_Var"><span class="id" title="constructor">T_Var</span></a>. <span class="id" title="tactic">rewrite</span> &lt;- <span class="id" title="var">H<sub>0</sub></span>; <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Abs&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#T_Abs"><span class="id" title="constructor">T_Abs</span></a>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <span class="id" title="var">IHhas_type</span>. <span class="id" title="tactic">intros</span> <span class="id" title="var">x<sub>1</sub></span> <span class="id" title="var">Hafi</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;the&nbsp;only&nbsp;tricky&nbsp;step...&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">x</span> <span class="id" title="var">x<sub>1</sub></span>); <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_eq</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_eq</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">reflexivity</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_neq</span>; [| <span class="id" title="tactic">assumption</span>].<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">update_neq</span>; [| <span class="id" title="tactic">assumption</span>].<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">auto</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<br/>
<span class="id" title="keyword">Lemma</span> <a id="free_in_context" class="idref" href="#free_in_context"><span class="id" title="lemma">free_in_context</span></a> : <span class="id" title="keyword">∀</span> <a id="x:145" class="idref" href="#x:145"><span class="id" title="binder">x</span></a> <a id="t:146" class="idref" href="#t:146"><span class="id" title="binder">t</span></a> <a id="T:147" class="idref" href="#T:147"><span class="id" title="binder">T</span></a> <a id="Gamma:148" class="idref" href="#Gamma:148"><span class="id" title="binder">Gamma</span></a>,<br/>
&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#appears_free_in"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:145"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#t:146"><span class="id" title="variable">t</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:148"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:146"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T:147"><span class="id" title="variable">T</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#a883bdd010993579f99d60b3775bcf54"><span class="id" title="notation">∃</span></a> <a id="T':149" class="idref" href="#T':149"><span class="id" title="binder">T'</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#a883bdd010993579f99d60b3775bcf54"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#Gamma:148"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#x:145"><span class="id" title="variable">x</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#Some"><span class="id" title="constructor">Some</span></a> <a class="idref" href="Norm.html#T':149"><span class="id" title="variable">T'</span></a>.<br/>
<div class="togglescript" id="proofcontrol3" onclick="toggleDisplay('proof3');toggleDisplay('proofcontrol3')"><span class="show"></span></div>
<div class="proofscript" id="proof3" onclick="toggleDisplay('proof3');toggleDisplay('proofcontrol3')">
<span class="id" title="keyword">Proof</span> <span class="id" title="keyword">with</span> <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">x</span> <span class="id" title="var">t</span> <span class="id" title="var">T</span> <span class="id" title="var">Gamma</span> <span class="id" title="var">Hafi</span> <span class="id" title="var">Htyp</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">Htyp</span>; <span class="id" title="tactic">inversion</span> <span class="id" title="var">Hafi</span>; <span class="id" title="tactic">subst</span>...<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Abs&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">IHHtyp</span> <span class="id" title="keyword">as</span> [<span class="id" title="var">T'</span> <span class="id" title="var">Hctx</span>]... <span class="id" title="tactic">∃</span> <span class="id" title="var">T'</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">unfold</span> <span class="id" title="definition">update</span>, <span class="id" title="definition">t_update</span> <span class="id" title="tactic">in</span> <span class="id" title="var">Hctx</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">false_eqb_string</span> <span class="id" title="tactic">in</span> <span class="id" title="var">Hctx</span>...<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<br/>
<span class="id" title="keyword">Corollary</span> <a id="typable_empty__closed" class="idref" href="#typable_empty__closed"><span class="id" title="lemma">typable_empty__closed</span></a> : <span class="id" title="keyword">∀</span> <a id="t:150" class="idref" href="#t:150"><span class="id" title="binder">t</span></a> <a id="T:151" class="idref" href="#T:151"><span class="id" title="binder">T</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:150"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T:151"><span class="id" title="variable">T</span></a>  <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#closed"><span class="id" title="definition">closed</span></a> <a class="idref" href="Norm.html#t:150"><span class="id" title="variable">t</span></a>.<br/>
<div class="togglescript" id="proofcontrol4" onclick="toggleDisplay('proof4');toggleDisplay('proofcontrol4')"><span class="show"></span></div>
<div class="proofscript" id="proof4" onclick="toggleDisplay('proof4');toggleDisplay('proofcontrol4')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span>. <span class="id" title="tactic">unfold</span> <a class="idref" href="Norm.html#closed"><span class="id" title="definition">closed</span></a>. <span class="id" title="tactic">intros</span> <span class="id" title="var">x</span> <span class="id" title="var">H<sub>1</sub></span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<a class="idref" href="Norm.html#free_in_context"><span class="id" title="lemma">free_in_context</span></a> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">H<sub>1</sub></span> <span class="id" title="var">H</span>) <span class="id" title="keyword">as</span> [<span class="id" title="var">T'</span> <span class="id" title="var">C</span>].<br/>
&nbsp;&nbsp;<span class="id" title="tactic">discriminate</span> <span class="id" title="var">C</span>. <span class="id" title="keyword">Qed</span>.<br/>
</div>
</div>

<div class="doc">
<a id="lab461"></a><h3 class="section">Determinism</h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="step_deterministic" class="idref" href="#step_deterministic"><span class="id" title="lemma">step_deterministic</span></a> :<br/>
&nbsp;&nbsp;&nbsp;<a class="idref" href="Smallstep.html#deterministic"><span class="id" title="definition">deterministic</span></a> <a class="idref" href="Norm.html#step"><span class="id" title="inductive">step</span></a>.<br/>
<div class="togglescript" id="proofcontrol5" onclick="toggleDisplay('proof5');toggleDisplay('proofcontrol5')"><span class="show"></span></div>
<div class="proofscript" id="proof5" onclick="toggleDisplay('proof5');toggleDisplay('proofcontrol5')">
<span class="id" title="keyword">Proof</span> <span class="id" title="keyword">with</span> <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">unfold</span> <a class="idref" href="Smallstep.html#deterministic"><span class="id" title="definition">deterministic</span></a>.<br/>
&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">t</span> <span class="id" title="var">t'</span> <span class="id" title="var">t''</span> <span class="id" title="var">E<sub>1</sub></span> <span class="id" title="var">E<sub>2</sub></span>.<br/>
&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">generalize</span> <span class="id" title="tactic">dependent</span> <span class="id" title="var">t''</span>.<br/>
&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">E<sub>1</sub></span>; <span class="id" title="tactic">intros</span> <span class="id" title="var">t''</span> <span class="id" title="var">E<sub>2</sub></span>; <span class="id" title="tactic">inversion</span> <span class="id" title="var">E<sub>2</sub></span>; <span class="id" title="tactic">subst</span>; <span class="id" title="tactic">clear</span> <span class="id" title="var">E<sub>2</sub></span>...<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;ST_AppAbs&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="tactic">inversion</span> <span class="id" title="var">H<sub>3</sub></span>.<br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="var">exfalso</span>; <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#value__normal"><span class="id" title="lemma">value__normal</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">H</span>...<br/>
&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;ST_App1&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="tactic">inversion</span> <span class="id" title="var">E<sub>1</sub></span>.<br/>
&nbsp;&nbsp;&nbsp;-  <span class="id" title="tactic">f_equal</span>...<br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="var">exfalso</span>; <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#value__normal"><span class="id" title="lemma">value__normal</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>1</sub></span>...<br/>
&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;ST_App2&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="var">exfalso</span>; <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#value__normal"><span class="id" title="lemma">value__normal</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>3</sub></span>...<br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="var">exfalso</span>; <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#value__normal"><span class="id" title="lemma">value__normal</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">H</span>...<br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="tactic">f_equal</span>...<br/>
&nbsp;&nbsp;&nbsp;- <span class="comment">(*&nbsp;ST_IfTrue&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">H<sub>3</sub></span>.<br/>
&nbsp;&nbsp;&nbsp;- <span class="comment">(*&nbsp;ST_IfFalse&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">H<sub>3</sub></span>.<br/>
&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;ST_If&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="tactic">inversion</span> <span class="id" title="var">E<sub>1</sub></span>.<br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="tactic">inversion</span> <span class="id" title="var">E<sub>1</sub></span>.<br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="tactic">f_equal</span>...<br/>
&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;ST_Pair1&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="tactic">f_equal</span>...<br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="var">exfalso</span>; <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#value__normal"><span class="id" title="lemma">value__normal</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>1</sub></span>...<br/>
&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;ST_Pair2&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="var">exfalso</span>; <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#value__normal"><span class="id" title="lemma">value__normal</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">H</span>...<br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="tactic">f_equal</span>...<br/>
&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;ST_Fst1&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="tactic">f_equal</span>...<br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="var">exfalso</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">E<sub>1</sub></span>; <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#value__normal"><span class="id" title="lemma">value__normal</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>0</sub></span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#value__normal"><span class="id" title="lemma">value__normal</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>1</sub></span>...<br/>
&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;ST_FstPair&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="var">exfalso</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">H<sub>2</sub></span>; <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#value__normal"><span class="id" title="lemma">value__normal</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">H</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#value__normal"><span class="id" title="lemma">value__normal</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>0</sub></span>...<br/>
&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;ST_Snd1&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="tactic">f_equal</span>...<br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="var">exfalso</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">E<sub>1</sub></span>; <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#value__normal"><span class="id" title="lemma">value__normal</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>0</sub></span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#value__normal"><span class="id" title="lemma">value__normal</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>1</sub></span>...<br/>
&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;ST_SndPair&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;- <span class="id" title="var">exfalso</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">H<sub>2</sub></span>; <span class="id" title="tactic">subst</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#value__normal"><span class="id" title="lemma">value__normal</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">H</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#value__normal"><span class="id" title="lemma">value__normal</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>0</sub></span>...<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>
</div>

<div class="doc">
<a id="lab462"></a><h1 class="section">Normalization</h1>

<div class="paragraph"> </div>

 Now for the actual normalization proof.

<div class="paragraph"> </div>

    Our goal is to prove that every well-typed term reduces to a
    normal form.  In fact, it turns out to be convenient to prove
    something slightly stronger, namely that every well-typed term
    reduces to a <i>value</i>.  This follows from the weaker property
    anyway via Progress (why?) but otherwise we don't need Progress,
    and we didn't bother re-proving it above.

<div class="paragraph"> </div>

    Here's the key definition: 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Definition</span> <a id="halts" class="idref" href="#halts"><span class="id" title="definition">halts</span></a>  (<a id="t:152" class="idref" href="#t:152"><span class="id" title="binder">t</span></a>:<a class="idref" href="Norm.html#tm"><span class="id" title="inductive">tm</span></a>) : <span class="id" title="keyword">Prop</span> :=  <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#a883bdd010993579f99d60b3775bcf54"><span class="id" title="notation">∃</span></a> <a id="t':153" class="idref" href="#t':153"><span class="id" title="binder">t'</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#a883bdd010993579f99d60b3775bcf54"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#t:152"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#a781e4b1e2c022f0326182a9bd099911"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span></span></a> <a class="idref" href="Norm.html#t':153"><span class="id" title="variable">t'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#ba2b0e492d2b4675a0acf3ea92aabadd"><span class="id" title="notation">∧</span></a>  <a class="idref" href="Norm.html#value"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#t':153"><span class="id" title="variable">t'</span></a>.<br/>
</div>

<div class="doc">
A trivial fact: 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="value_halts" class="idref" href="#value_halts"><span class="id" title="lemma">value_halts</span></a> : <span class="id" title="keyword">∀</span> <a id="v:154" class="idref" href="#v:154"><span class="id" title="binder">v</span></a>, <a class="idref" href="Norm.html#value"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#v:154"><span class="id" title="variable">v</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#halts"><span class="id" title="definition">halts</span></a> <a class="idref" href="Norm.html#v:154"><span class="id" title="variable">v</span></a>.<br/>
<div class="togglescript" id="proofcontrol6" onclick="toggleDisplay('proof6');toggleDisplay('proofcontrol6')"><span class="show"></span></div>
<div class="proofscript" id="proof6" onclick="toggleDisplay('proof6');toggleDisplay('proofcontrol6')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">v</span> <span class="id" title="var">H</span>. <span class="id" title="tactic">unfold</span> <a class="idref" href="Norm.html#halts"><span class="id" title="definition">halts</span></a>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <span class="id" title="var">v</span>. <span class="id" title="tactic">split</span>.<br/>
&nbsp;&nbsp;- <span class="id" title="tactic">apply</span> <a class="idref" href="Smallstep.html#multi_refl"><span class="id" title="constructor">multi_refl</span></a>.<br/>
&nbsp;&nbsp;- <span class="id" title="tactic">assumption</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>
</div>

<div class="doc">
The key issue in the normalization proof (as in many proofs by
    induction) is finding a strong enough induction hypothesis.  To
    this end, we begin by defining, for each type <span class="inlinecode"><span class="id" title="var">T</span></span>, a set <span class="inlinecode"><span class="id" title="var">R_T</span></span> of
    closed terms of type <span class="inlinecode"><span class="id" title="var">T</span></span>.  We will specify these sets using a
    relation <span class="inlinecode"><span class="id" title="var">R</span></span> and write <span class="inlinecode"><span class="id" title="var">R</span></span> <span class="inlinecode"><span class="id" title="var">T</span></span> <span class="inlinecode"><span class="id" title="var">t</span></span> when <span class="inlinecode"><span class="id" title="var">t</span></span> is in <span class="inlinecode"><span class="id" title="var">R_T</span></span>. (The sets
    <span class="inlinecode"><span class="id" title="var">R_T</span></span> are sometimes called <i>saturated sets</i> or <i>reducibility
    candidates</i>.)

<div class="paragraph"> </div>

    Here is the definition of <span class="inlinecode"><span class="id" title="var">R</span></span> for the base language:

<div class="paragraph"> </div>

<ul class="doclist">
<li> <span class="inlinecode"><span class="id" title="var">R</span></span> <span class="inlinecode"><span class="id" title="var">bool</span></span> <span class="inlinecode"><span class="id" title="var">t</span></span> iff <span class="inlinecode"><span class="id" title="var">t</span></span> is a closed term of type <span class="inlinecode"><span class="id" title="var">bool</span></span> and <span class="inlinecode"><span class="id" title="var">t</span></span> halts
      in a value

<div class="paragraph"> </div>


</li>
<li> <span class="inlinecode"><span class="id" title="var">R</span></span> <span class="inlinecode">(<span class="id" title="var">T<sub>1</sub></span></span> <span class="inlinecode">→</span> <span class="inlinecode"><span class="id" title="var">T<sub>2</sub></span>)</span> <span class="inlinecode"><span class="id" title="var">t</span></span> iff <span class="inlinecode"><span class="id" title="var">t</span></span> is a closed term of type <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span></span> <span class="inlinecode">→</span> <span class="inlinecode"><span class="id" title="var">T<sub>2</sub></span></span> and
      <span class="inlinecode"><span class="id" title="var">t</span></span> halts in a value <i>and</i> for any term <span class="inlinecode"><span class="id" title="var">s</span></span> such that <span class="inlinecode"><span class="id" title="var">R</span></span> <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span></span> <span class="inlinecode"><span class="id" title="var">s</span></span>,
      we have <span class="inlinecode"><span class="id" title="var">R</span></span> <span class="inlinecode"><span class="id" title="var">T<sub>2</sub></span></span> <span class="inlinecode">(<span class="id" title="var">t</span></span> <span class="inlinecode"><span class="id" title="var">s</span>)</span>. 
</li>
</ul>

<div class="paragraph"> </div>

 This definition gives us the strengthened induction hypothesis that we
    need.  Our primary goal is to show that all <i>programs</i> ---i.e., all
    closed terms of base type---halt.  But closed terms of base type can
    contain subterms of functional type, so we need to know something
    about these as well.  Moreover, it is not enough to know that these
    subterms halt, because the application of a normalized function to a
    normalized argument involves a substitution, which may enable more
    reduction steps.  So we need a stronger condition for terms of
    functional type: not only should they halt themselves, but, when
    applied to halting arguments, they should yield halting results.

<div class="paragraph"> </div>

    The form of <span class="inlinecode"><span class="id" title="var">R</span></span> is characteristic of the <i>logical relations</i> proof
    technique.  (Since we are just dealing with unary relations here, we
    could perhaps more properly say <i>logical properties</i>.)  If we want to
    prove some property <span class="inlinecode"><span class="id" title="var">P</span></span> of all closed terms of type <span class="inlinecode"><span class="id" title="var">A</span></span>, we proceed by
    proving, by induction on types, that all terms of type <span class="inlinecode"><span class="id" title="var">A</span></span> <i>possess</i>
    property <span class="inlinecode"><span class="id" title="var">P</span></span>, all terms of type <span class="inlinecode"><span class="id" title="var">A</span>→<span class="id" title="var">A</span></span> <i>preserve</i> property <span class="inlinecode"><span class="id" title="var">P</span></span>, all
    terms of type <span class="inlinecode">(<span class="id" title="var">A</span>→<span class="id" title="var">A</span>)<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>(<span class="id" title="var">A</span>→<span class="id" title="var">A</span>)</span> <i>preserve the property of preserving</i>
    property <span class="inlinecode"><span class="id" title="var">P</span></span>, and so on.  We do this by defining a family of
    properties, indexed by types.  For the base type <span class="inlinecode"><span class="id" title="var">A</span></span>, the property is
    just <span class="inlinecode"><span class="id" title="var">P</span></span>.  For functional types, it says that the function should map
    values satisfying the property at the input type to values satisfying
    the property at the output type.

<div class="paragraph"> </div>

    When we come to formalize the definition of <span class="inlinecode"><span class="id" title="var">R</span></span> in Coq, we hit a
    problem.  The most obvious formulation would be as a parameterized
    Inductive proposition like this:
<br/>
<span class="inlinecode">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">Inductive</span> <span class="id" title="var">R</span> : <span class="id" title="var">ty</span> → <span class="id" title="var">tm</span> → <span class="id" title="keyword">Prop</span> :=<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| <span class="id" title="var">R_bool</span> : <span class="id" title="keyword">∀</span> <span class="id" title="var">b</span> <span class="id" title="var">t</span>, <span class="id" title="var">empty</span> &#x22A2; <span class="id" title="var">t</span> \<span class="id" title="tactic">in</span> <span class="id" title="var">Bool</span> →<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">halts</span> <span class="id" title="var">t</span> →<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">R</span> <span class="id" title="var">Bool</span> <span class="id" title="var">t</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| <span class="id" title="var">R_arrow</span> : <span class="id" title="keyword">∀</span> <span class="id" title="var">T<sub>1</sub></span> <span class="id" title="var">T<sub>2</sub></span> <span class="id" title="var">t</span>, <span class="id" title="var">empty</span> &#x22A2; <span class="id" title="var">t</span> \<span class="id" title="tactic">in</span> (<span class="id" title="var">Arrow</span> <span class="id" title="var">T<sub>1</sub></span> <span class="id" title="var">T<sub>2</sub></span>) →<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">halts</span> <span class="id" title="var">t</span> →<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<span class="id" title="keyword">∀</span> <span class="id" title="var">s</span>, <span class="id" title="var">R</span> <span class="id" title="var">T<sub>1</sub></span> <span class="id" title="var">s</span> → <span class="id" title="var">R</span> <span class="id" title="var">T<sub>2</sub></span> (<span class="id" title="var">app</span> <span class="id" title="var">t</span> <span class="id" title="var">s</span>)) →<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">R</span> (<span class="id" title="var">Arrow</span> <span class="id" title="var">T<sub>1</sub></span> <span class="id" title="var">T<sub>2</sub></span>) <span class="id" title="var">t</span>.
<div class="paragraph"> </div>

</span>    Unfortunately, Coq rejects this definition because it violates the
    <i>strict positivity requirement</i> for inductive definitions, which says
    that the type being defined must not occur to the left of an arrow in
    the type of a constructor argument. Here, it is the third argument to
    <span class="inlinecode"><span class="id" title="var">R_arrow</span></span>, namely <span class="inlinecode">(<span class="id" title="keyword">∀</span></span> <span class="inlinecode"><span class="id" title="var">s</span>,</span> <span class="inlinecode"><span class="id" title="var">R</span></span> <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span></span> <span class="inlinecode"><span class="id" title="var">s</span></span> <span class="inlinecode">→</span> <span class="inlinecode"><span class="id" title="var">R</span></span> <span class="inlinecode"><span class="id" title="var">TS</span></span> <span class="inlinecode">(<span class="id" title="var">app</span></span> <span class="inlinecode"><span class="id" title="var">t</span></span> <span class="inlinecode"><span class="id" title="var">s</span>))</span>, and
    specifically the <span class="inlinecode"><span class="id" title="var">R</span></span> <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span></span> <span class="inlinecode"><span class="id" title="var">s</span></span> part, that violates this rule.  (The
    outermost arrows separating the constructor arguments don't count when
    applying this rule; otherwise we could never have genuinely inductive
    properties at all!)  The reason for the rule is that types defined
    with non-positive recursion can be used to build non-terminating
    functions, which as we know would be a disaster for Coq's logical
    soundness. Even though the relation we want in this case might be
    perfectly innocent, Coq still rejects it because it fails the
    positivity test.

<div class="paragraph"> </div>

    Fortunately, it turns out that we <i>can</i> define <span class="inlinecode"><span class="id" title="var">R</span></span> using a
    <span class="inlinecode"><span class="id" title="keyword">Fixpoint</span></span>: 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Fixpoint</span> <a id="R" class="idref" href="#R"><span class="id" title="definition">R</span></a> (<a id="T:155" class="idref" href="#T:155"><span class="id" title="binder">T</span></a>:<a class="idref" href="Norm.html#ty"><span class="id" title="inductive">ty</span></a>) (<a id="t:156" class="idref" href="#t:156"><span class="id" title="binder">t</span></a>:<a class="idref" href="Norm.html#tm"><span class="id" title="inductive">tm</span></a>) : <span class="id" title="keyword">Prop</span> :=<br/>
&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:156"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T:155"><span class="id" title="variable">T</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#ba2b0e492d2b4675a0acf3ea92aabadd"><span class="id" title="notation">∧</span></a> <a class="idref" href="Norm.html#halts"><span class="id" title="definition">halts</span></a> <a class="idref" href="Norm.html#t:156"><span class="id" title="variable">t</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#ba2b0e492d2b4675a0acf3ea92aabadd"><span class="id" title="notation">∧</span></a><br/>
&nbsp;&nbsp;<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#ba2b0e492d2b4675a0acf3ea92aabadd"><span class="id" title="notation">(</span></a><span class="id" title="keyword">match</span> <a class="idref" href="Norm.html#T:155"><span class="id" title="variable">T</span></a> <span class="id" title="keyword">with</span><br/>
&nbsp;&nbsp;&nbsp;| <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#:stlc::'Bool'"><span class="id" title="notation">Bool</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a>  ⇒ <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#True"><span class="id" title="inductive">True</span></a><br/>
&nbsp;&nbsp;&nbsp;| <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <span class="id" title="var">T<sub>1</sub></span> <a class="idref" href="Norm.html#:stlc::x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <span class="id" title="var">T<sub>2</sub></span> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> ⇒ (<span class="id" title="keyword">∀</span> <a id="s:159" class="idref" href="#s:159"><span class="id" title="binder">s</span></a>, <a class="idref" href="Norm.html#R:157"><span class="id" title="definition">R</span></a> <span class="id" title="var">T<sub>1</sub></span> <a class="idref" href="Norm.html#s:159"><span class="id" title="variable">s</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#R:157"><span class="id" title="definition">R</span></a> <span class="id" title="var">T<sub>2</sub></span> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a><a class="idref" href="Norm.html#t:156"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#s:159"><span class="id" title="variable">s</span></a><a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> )<br/>
<br/>
&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;...&nbsp;edit&nbsp;the&nbsp;next&nbsp;line&nbsp;when&nbsp;dealing&nbsp;with&nbsp;products&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;| <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <span class="id" title="var">T<sub>1</sub></span> <a class="idref" href="Norm.html#58c5958b1bbf365bea74423471b3a186"><span class="id" title="notation">×</span></a> <span class="id" title="var">T<sub>2</sub></span> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> ⇒ <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#False"><span class="id" title="inductive">False</span></a>    <span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">end</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#ba2b0e492d2b4675a0acf3ea92aabadd"><span class="id" title="notation">)</span></a>.<br/>
</div>

<div class="doc">
As immediate consequences of this definition, we have that every
    element of every set <span class="inlinecode"><span class="id" title="var">R_T</span></span> halts in a value and is closed with type
    <span class="inlinecode"><span class="id" title="var">t</span></span> :
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="R_halts" class="idref" href="#R_halts"><span class="id" title="lemma">R_halts</span></a> : <span class="id" title="keyword">∀</span> {<a id="T:160" class="idref" href="#T:160"><span class="id" title="binder">T</span></a>} {<a id="t:161" class="idref" href="#t:161"><span class="id" title="binder">t</span></a>}, <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <a class="idref" href="Norm.html#T:160"><span class="id" title="variable">T</span></a> <a class="idref" href="Norm.html#t:161"><span class="id" title="variable">t</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#halts"><span class="id" title="definition">halts</span></a> <a class="idref" href="Norm.html#t:161"><span class="id" title="variable">t</span></a>.<br/>
<div class="togglescript" id="proofcontrol7" onclick="toggleDisplay('proof7');toggleDisplay('proofcontrol7')"><span class="show"></span></div>
<div class="proofscript" id="proof7" onclick="toggleDisplay('proof7');toggleDisplay('proofcontrol7')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">T</span>; <span class="id" title="tactic">unfold</span> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span> <span class="id" title="keyword">as</span> [<span class="id" title="var">_</span> [<span class="id" title="var">H</span> <span class="id" title="var">_</span>]]; <span class="id" title="tactic">assumption</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<br/>
<span class="id" title="keyword">Lemma</span> <a id="R_typable_empty" class="idref" href="#R_typable_empty"><span class="id" title="lemma">R_typable_empty</span></a> : <span class="id" title="keyword">∀</span> {<a id="T:162" class="idref" href="#T:162"><span class="id" title="binder">T</span></a>} {<a id="t:163" class="idref" href="#t:163"><span class="id" title="binder">t</span></a>}, <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <a class="idref" href="Norm.html#T:162"><span class="id" title="variable">T</span></a> <a class="idref" href="Norm.html#t:163"><span class="id" title="variable">t</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <span class="id" title="definition">empty</span> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:163"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T:162"><span class="id" title="variable">T</span></a>.<br/>
<div class="togglescript" id="proofcontrol8" onclick="toggleDisplay('proof8');toggleDisplay('proofcontrol8')"><span class="show"></span></div>
<div class="proofscript" id="proof8" onclick="toggleDisplay('proof8');toggleDisplay('proofcontrol8')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">T</span>; <span class="id" title="tactic">unfold</span> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">destruct</span> <span class="id" title="var">H</span> <span class="id" title="keyword">as</span> [<span class="id" title="var">H</span> <span class="id" title="var">_</span>]; <span class="id" title="tactic">assumption</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>
</div>

<div class="doc">
Now we proceed to show the main result, which is that every
    well-typed term of type <span class="inlinecode"><span class="id" title="var">T</span></span> is an element of <span class="inlinecode"><span class="id" title="var">R_T</span></span>.  Together with
    <span class="inlinecode"><span class="id" title="var">R_halts</span></span>, that will show that every well-typed term halts in a
    value.  
</div>

<div class="doc">
<a id="lab463"></a><h2 class="section">Membership in <span class="inlinecode"><span class="id" title="var">R_T</span></span> Is Invariant Under Reduction</h2>

<div class="paragraph"> </div>

 We start with a preliminary lemma that shows a kind of strong
    preservation property, namely that membership in <span class="inlinecode"><span class="id" title="var">R_T</span></span> is <i>invariant</i>
    under reduction. We will need this property in both directions,
    i.e., both to show that a term in <span class="inlinecode"><span class="id" title="var">R_T</span></span> stays in <span class="inlinecode"><span class="id" title="var">R_T</span></span> when it takes a
    forward step, and to show that any term that ends up in <span class="inlinecode"><span class="id" title="var">R_T</span></span> after a
    step must have been in <span class="inlinecode"><span class="id" title="var">R_T</span></span> to begin with.

<div class="paragraph"> </div>

    First of all, an easy preliminary lemma. Note that in the forward
    direction the proof depends on the fact that our language is
    determinstic. This lemma might still be true for nondeterministic
    languages, but the proof would be harder! 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="step_preserves_halting" class="idref" href="#step_preserves_halting"><span class="id" title="lemma">step_preserves_halting</span></a> :<br/>
&nbsp;&nbsp;<span class="id" title="keyword">∀</span> <a id="t:164" class="idref" href="#t:164"><span class="id" title="binder">t</span></a> <a id="t':165" class="idref" href="#t':165"><span class="id" title="binder">t'</span></a>, <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#t:164"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#t':165"><span class="id" title="variable">t'</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">)</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#halts"><span class="id" title="definition">halts</span></a> <a class="idref" href="Norm.html#t:164"><span class="id" title="variable">t</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'&lt;-&gt;'_x"><span class="id" title="notation">↔</span></a> <a class="idref" href="Norm.html#halts"><span class="id" title="definition">halts</span></a> <a class="idref" href="Norm.html#t':165"><span class="id" title="variable">t'</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">)</span></a>.<br/>
<div class="togglescript" id="proofcontrol9" onclick="toggleDisplay('proof9');toggleDisplay('proofcontrol9')"><span class="show"></span></div>
<div class="proofscript" id="proof9" onclick="toggleDisplay('proof9');toggleDisplay('proofcontrol9')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">t</span> <span class="id" title="var">t'</span> <span class="id" title="var">ST</span>. <span class="id" title="tactic">unfold</span> <a class="idref" href="Norm.html#halts"><span class="id" title="definition">halts</span></a>.<br/>
&nbsp;<span class="id" title="tactic">split</span>.<br/>
&nbsp;- <span class="comment">(*&nbsp;<span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:5%;'><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span>&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> [<span class="id" title="var">t''</span> [<span class="id" title="var">STM</span> <span class="id" title="var">V</span>]].<br/>
&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">STM</span>.<br/>
&nbsp;&nbsp;&nbsp;+ <span class="id" title="var">exfalso</span>; <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#value__normal"><span class="id" title="lemma">value__normal</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">V</span>; <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">rewrite</span> (<a class="idref" href="Norm.html#step_deterministic"><span class="id" title="lemma">step_deterministic</span></a> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">ST</span> <span class="id" title="var">H</span>). <span class="id" title="tactic">∃</span> <span class="id" title="var">z</span>. <span class="id" title="tactic">split</span>; <span class="id" title="tactic">assumption</span>.<br/>
&nbsp;- <span class="comment">(*&nbsp;&lt;-&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> [<span class="id" title="var">t'0</span> [<span class="id" title="var">STM</span> <span class="id" title="var">V</span>]].<br/>
&nbsp;&nbsp;<span class="id" title="tactic">∃</span> <span class="id" title="var">t'0</span>. <span class="id" title="tactic">split</span>; <span class="id" title="tactic">eauto</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>
</div>

<div class="doc">
Now the main lemma, which comes in two parts, one for each
    direction.  Each proceeds by induction on the structure of the type
    <span class="inlinecode"><span class="id" title="var">T</span></span>. In fact, this is where we make fundamental use of the
    structure of types.

<div class="paragraph"> </div>

    One requirement for staying in <span class="inlinecode"><span class="id" title="var">R_T</span></span> is to stay in type <span class="inlinecode"><span class="id" title="var">T</span></span>. In the
    forward direction, we get this from ordinary type Preservation. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="step_preserves_R" class="idref" href="#step_preserves_R"><span class="id" title="lemma">step_preserves_R</span></a> : <span class="id" title="keyword">∀</span> <a id="T:166" class="idref" href="#T:166"><span class="id" title="binder">T</span></a> <a id="t:167" class="idref" href="#t:167"><span class="id" title="binder">t</span></a> <a id="t':168" class="idref" href="#t':168"><span class="id" title="binder">t'</span></a>, <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#t:167"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#t':168"><span class="id" title="variable">t'</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">)</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <a class="idref" href="Norm.html#T:166"><span class="id" title="variable">T</span></a> <a class="idref" href="Norm.html#t:167"><span class="id" title="variable">t</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <a class="idref" href="Norm.html#T:166"><span class="id" title="variable">T</span></a> <a class="idref" href="Norm.html#t':168"><span class="id" title="variable">t'</span></a>.<br/>
<div class="togglescript" id="proofcontrol10" onclick="toggleDisplay('proof10');toggleDisplay('proofcontrol10')"><span class="show"></span></div>
<div class="proofscript" id="proof10" onclick="toggleDisplay('proof10');toggleDisplay('proofcontrol10')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">T</span>;  <span class="id" title="tactic">intros</span> <span class="id" title="var">t</span> <span class="id" title="var">t'</span> <span class="id" title="var">E</span> <span class="id" title="var">Rt</span>; <span class="id" title="tactic">unfold</span> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a>; <span class="id" title="tactic">fold</span> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a>; <span class="id" title="tactic">unfold</span> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">Rt</span>; <span class="id" title="tactic">fold</span> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">Rt</span>;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">Rt</span> <span class="id" title="keyword">as</span> [<span class="id" title="var">typable_empty_t</span> [<span class="id" title="var">halts_t</span> <span class="id" title="var">RRt</span>]].<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;Bool&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="id" title="tactic">split</span>. <span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#preservation"><span class="id" title="lemma">preservation</span></a>; <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">split</span>. <span class="id" title="tactic">apply</span> (<a class="idref" href="Norm.html#step_preserves_halting"><span class="id" title="lemma">step_preserves_halting</span></a> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">E</span>); <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;Arrow&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="id" title="tactic">split</span>. <span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#preservation"><span class="id" title="lemma">preservation</span></a>; <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">split</span>. <span class="id" title="tactic">apply</span> (<a class="idref" href="Norm.html#step_preserves_halting"><span class="id" title="lemma">step_preserves_halting</span></a> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">E</span>); <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <span class="id" title="var">IHT2</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">apply</span>  <a class="idref" href="Norm.html#ST_App1"><span class="id" title="constructor">ST_App1</span></a>. <span class="id" title="tactic">apply</span> <span class="id" title="var">E</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <span class="id" title="var">RRt</span>; <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
</div>
</div>

<div class="doc">
The generalization to multiple steps is trivial: 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="multistep_preserves_R" class="idref" href="#multistep_preserves_R"><span class="id" title="lemma">multistep_preserves_R</span></a> : <span class="id" title="keyword">∀</span> <a id="T:169" class="idref" href="#T:169"><span class="id" title="binder">T</span></a> <a id="t:170" class="idref" href="#t:170"><span class="id" title="binder">t</span></a> <a id="t':171" class="idref" href="#t':171"><span class="id" title="binder">t'</span></a>,<br/>
&nbsp;&nbsp;<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#t:170"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#a781e4b1e2c022f0326182a9bd099911"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span></span></a> <a class="idref" href="Norm.html#t':171"><span class="id" title="variable">t'</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">)</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <a class="idref" href="Norm.html#T:169"><span class="id" title="variable">T</span></a> <a class="idref" href="Norm.html#t:170"><span class="id" title="variable">t</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <a class="idref" href="Norm.html#T:169"><span class="id" title="variable">T</span></a> <a class="idref" href="Norm.html#t':171"><span class="id" title="variable">t'</span></a>.<br/>
<div class="togglescript" id="proofcontrol11" onclick="toggleDisplay('proof11');toggleDisplay('proofcontrol11')"><span class="show"></span></div>
<div class="proofscript" id="proof11" onclick="toggleDisplay('proof11');toggleDisplay('proofcontrol11')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">T</span> <span class="id" title="var">t</span> <span class="id" title="var">t'</span> <span class="id" title="var">STM</span>; <span class="id" title="tactic">induction</span> <span class="id" title="var">STM</span>; <span class="id" title="tactic">intros</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">assumption</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <span class="id" title="var">IHSTM</span>. <span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#step_preserves_R"><span class="id" title="axiom">step_preserves_R</span></a>. <span class="id" title="tactic">apply</span> <span class="id" title="var">H</span>. <span class="id" title="tactic">assumption</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>
</div>

<div class="doc">
In the reverse direction, we must add the fact that <span class="inlinecode"><span class="id" title="var">t</span></span> has type
   <span class="inlinecode"><span class="id" title="var">T</span></span> before stepping as an additional hypothesis. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="step_preserves_R'" class="idref" href="#step_preserves_R'"><span class="id" title="lemma">step_preserves_R'</span></a> : <span class="id" title="keyword">∀</span> <a id="T:172" class="idref" href="#T:172"><span class="id" title="binder">T</span></a> <a id="t:173" class="idref" href="#t:173"><span class="id" title="binder">t</span></a> <a id="t':174" class="idref" href="#t':174"><span class="id" title="binder">t'</span></a>,<br/>
&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:173"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T:172"><span class="id" title="variable">T</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#t:173"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#:::x_'--&gt;'_x"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span>&gt;</span></span></span></a> <a class="idref" href="Norm.html#t':174"><span class="id" title="variable">t'</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">)</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <a class="idref" href="Norm.html#T:172"><span class="id" title="variable">T</span></a> <a class="idref" href="Norm.html#t':174"><span class="id" title="variable">t'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <a class="idref" href="Norm.html#T:172"><span class="id" title="variable">T</span></a> <a class="idref" href="Norm.html#t:173"><span class="id" title="variable">t</span></a>.<br/>
<div class="togglescript" id="proofcontrol12" onclick="toggleDisplay('proof12');toggleDisplay('proofcontrol12')"><span class="show"></span></div>
<div class="proofscript" id="proof12" onclick="toggleDisplay('proof12');toggleDisplay('proofcontrol12')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
</div>

<br/>
<span class="id" title="keyword">Lemma</span> <a id="multistep_preserves_R'" class="idref" href="#multistep_preserves_R'"><span class="id" title="lemma">multistep_preserves_R'</span></a> : <span class="id" title="keyword">∀</span> <a id="T:175" class="idref" href="#T:175"><span class="id" title="binder">T</span></a> <a id="t:176" class="idref" href="#t:176"><span class="id" title="binder">t</span></a> <a id="t':177" class="idref" href="#t':177"><span class="id" title="binder">t'</span></a>,<br/>
&nbsp;&nbsp;<span class="id" title="definition">empty</span> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:176"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T:175"><span class="id" title="variable">T</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#t:176"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#a781e4b1e2c022f0326182a9bd099911"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span></span></a> <a class="idref" href="Norm.html#t':177"><span class="id" title="variable">t'</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">)</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <a class="idref" href="Norm.html#T:175"><span class="id" title="variable">T</span></a> <a class="idref" href="Norm.html#t':177"><span class="id" title="variable">t'</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <a class="idref" href="Norm.html#T:175"><span class="id" title="variable">T</span></a> <a class="idref" href="Norm.html#t:176"><span class="id" title="variable">t</span></a>.<br/>
<div class="togglescript" id="proofcontrol13" onclick="toggleDisplay('proof13');toggleDisplay('proofcontrol13')"><span class="show"></span></div>
<div class="proofscript" id="proof13" onclick="toggleDisplay('proof13');toggleDisplay('proofcontrol13')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">T</span> <span class="id" title="var">t</span> <span class="id" title="var">t'</span> <span class="id" title="var">HT</span> <span class="id" title="var">STM</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">STM</span>; <span class="id" title="tactic">intros</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">assumption</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#step_preserves_R'"><span class="id" title="axiom">step_preserves_R'</span></a>. <span class="id" title="tactic">assumption</span>. <span class="id" title="tactic">apply</span> <span class="id" title="var">H</span>. <span class="id" title="tactic">apply</span> <span class="id" title="var">IHSTM</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#preservation"><span class="id" title="lemma">preservation</span></a>;  <span class="id" title="tactic">eauto</span>. <span class="id" title="tactic">auto</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>
</div>

<div class="doc">
<a id="lab464"></a><h2 class="section">Closed Instances of Terms of Type <span class="inlinecode"><span class="id" title="var">t</span></span> Belong to <span class="inlinecode"><span class="id" title="var">R_T</span></span></h2>

<div class="paragraph"> </div>

 Now we proceed to show that every term of type <span class="inlinecode"><span class="id" title="var">T</span></span> belongs to
    <span class="inlinecode"><span class="id" title="var">R_T</span></span>.  Here, the induction will be on typing derivations (it would be
    surprising to see a proof about well-typed terms that did not
    somewhere involve induction on typing derivations!).  The only
    technical difficulty here is in dealing with the abstraction case.
    Since we are arguing by induction, the demonstration that a term
    <span class="inlinecode"><span class="id" title="var">abs</span></span> <span class="inlinecode"><span class="id" title="var">x</span></span> <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span></span> <span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span> belongs to <span class="inlinecode"><span class="id" title="var">R_</span>(<span class="id" title="var">T<sub>1</sub></span>→<span class="id" title="var">T<sub>2</sub></span>)</span> should involve applying the
    induction hypothesis to show that <span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span> belongs to <span class="inlinecode"><span class="id" title="var">R_</span>(<span class="id" title="var">T<sub>2</sub></span>)</span>.  But
    <span class="inlinecode"><span class="id" title="var">R_</span>(<span class="id" title="var">T<sub>2</sub></span>)</span> is defined to be a set of <i>closed</i> terms, while <span class="inlinecode"><span class="id" title="var">t<sub>2</sub></span></span> may
    contain <span class="inlinecode"><span class="id" title="var">x</span></span> free, so this does not make sense.

<div class="paragraph"> </div>

    This problem is resolved by using a standard trick to suitably
    generalize the induction hypothesis: instead of proving a statement
    involving a closed term, we generalize it to cover all closed
    <i>instances</i> of an open term <span class="inlinecode"><span class="id" title="var">t</span></span>.  Informally, the statement of the
    lemma will look like this:

<div class="paragraph"> </div>

    If <span class="inlinecode"><span class="id" title="var">x<sub>1</sub></span>:<span class="id" title="var">T<sub>1</sub></span>,..<span class="id" title="var">xn</span>:<span class="id" title="var">Tn</span></span> <span class="inlinecode">&#x22A2;</span> <span class="inlinecode"><span class="id" title="var">t</span></span> <span class="inlinecode">:</span> <span class="inlinecode"><span class="id" title="var">T</span></span> and <span class="inlinecode"><span class="id" title="var">v<sub>1</sub></span>,...,<span class="id" title="var">vn</span></span> are values such that
    <span class="inlinecode"><span class="id" title="var">R</span></span> <span class="inlinecode"><span class="id" title="var">T<sub>1</sub></span></span> <span class="inlinecode"><span class="id" title="var">v<sub>1</sub></span></span>, <span class="inlinecode"><span class="id" title="var">R</span></span> <span class="inlinecode"><span class="id" title="var">T<sub>2</sub></span></span> <span class="inlinecode"><span class="id" title="var">v<sub>2</sub></span></span>, ..., <span class="inlinecode"><span class="id" title="var">R</span></span> <span class="inlinecode"><span class="id" title="var">Tn</span></span> <span class="inlinecode"><span class="id" title="var">vn</span></span>, then
    <span class="inlinecode"><span class="id" title="var">R</span></span> <span class="inlinecode"><span class="id" title="var">T</span></span> <span class="inlinecode">([<span class="id" title="var">x<sub>1</sub></span>:=<span class="id" title="var">v<sub>1</sub></span>][<span class="id" title="var">x<sub>2</sub></span>:=<span class="id" title="var">v<sub>2</sub></span>]...[<span class="id" title="var">xn</span>:=<span class="id" title="var">vn</span>]<span class="id" title="var">t</span>)</span>.

<div class="paragraph"> </div>

    The proof will proceed by induction on the typing derivation
    <span class="inlinecode"><span class="id" title="var">x<sub>1</sub></span>:<span class="id" title="var">T<sub>1</sub></span>,..<span class="id" title="var">xn</span>:<span class="id" title="var">Tn</span></span> <span class="inlinecode">&#x22A2;</span> <span class="inlinecode"><span class="id" title="var">t</span></span> <span class="inlinecode">:</span> <span class="inlinecode"><span class="id" title="var">T</span></span>; the most interesting case will be the one
    for abstraction. 
</div>

<div class="doc">
<a id="lab465"></a><h3 class="section">Multisubstitutions, Multi-Extensions, and Instantiations</h3>

<div class="paragraph"> </div>

 However, before we can proceed to formalize the statement and
    proof of the lemma, we'll need to build some (rather tedious)
    machinery to deal with the fact that we are performing <i>multiple</i>
    substitutions on term <span class="inlinecode"><span class="id" title="var">t</span></span> and <i>multiple</i> extensions of the typing
    context.  In particular, we must be precise about the order in which
    the substitutions occur and how they act on each other.  Often these
    details are simply elided in informal paper proofs, but of course Coq
    won't let us do that. Since here we are substituting closed terms, we
    don't need to worry about how one substitution might affect the term
    put in place by another.  But we still do need to worry about the
    <i>order</i> of substitutions, because it is quite possible for the same
    identifier to appear multiple times among the <span class="inlinecode"><span class="id" title="var">x<sub>1</sub></span>,...<span class="id" title="var">xn</span></span> with
    different associated <span class="inlinecode"><span class="id" title="var">vi</span></span> and <span class="inlinecode"><span class="id" title="var">Ti</span></span>.

<div class="paragraph"> </div>

    To make everything precise, we will assume that environments are
    extended from left to right, and multiple substitutions are performed
    from right to left.  To see that this is consistent, suppose we have
    an environment written as <span class="inlinecode">...,<span class="id" title="var">y</span>:<span class="id" title="var">bool</span>,...,<span class="id" title="var">y</span>:<span class="id" title="var">nat</span>,...</span>  and a
    corresponding term substitution written as <span class="inlinecode">...[<span class="id" title="var">y</span>:=(<span class="id" title="var">tbool</span></span>
    <span class="inlinecode"><span class="id" title="var">true</span>)]...[<span class="id" title="var">y</span>:=(<span class="id" title="var">const</span></span> <span class="inlinecode">3)]...<span class="id" title="var">t</span></span>.  Since environments are extended from
    left to right, the binding <span class="inlinecode"><span class="id" title="var">y</span>:<span class="id" title="var">nat</span></span> hides the binding <span class="inlinecode"><span class="id" title="var">y</span>:<span class="id" title="var">bool</span></span>; since
    substitutions are performed right to left, we do the substitution
    <span class="inlinecode"><span class="id" title="var">y</span>:=(<span class="id" title="var">const</span></span> <span class="inlinecode">3)</span> first, so that the substitution <span class="inlinecode"><span class="id" title="var">y</span>:=(<span class="id" title="var">tbool</span></span> <span class="inlinecode"><span class="id" title="var">true</span>)</span> has
    no effect. Substitution thus correctly preserves the type of the term.

<div class="paragraph"> </div>

    With these points in mind, the following definitions should make sense.

<div class="paragraph"> </div>

    A <i>multisubstitution</i> is the result of applying a list of
    substitutions, which we call an <i>environment</i>. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Definition</span> <a id="env" class="idref" href="#env"><span class="id" title="definition">env</span></a> := <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#list"><span class="id" title="inductive">list</span></a> (<a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac<sub>4</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="Norm.html#tm"><span class="id" title="inductive">tm</span></a>).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Fixpoint</span> <a id="msubst" class="idref" href="#msubst"><span class="id" title="definition">msubst</span></a> (<a id="ss:178" class="idref" href="#ss:178"><span class="id" title="binder">ss</span></a>:<a class="idref" href="Norm.html#env"><span class="id" title="definition">env</span></a>) (<a id="t:179" class="idref" href="#t:179"><span class="id" title="binder">t</span></a>:<a class="idref" href="Norm.html#tm"><span class="id" title="inductive">tm</span></a>) : <a class="idref" href="Norm.html#tm"><span class="id" title="inductive">tm</span></a> :=<br/>
<span class="id" title="keyword">match</span> <a class="idref" href="Norm.html#ss:178"><span class="id" title="variable">ss</span></a> <span class="id" title="keyword">with</span><br/>
| <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nil"><span class="id" title="constructor">nil</span></a> ⇒ <a class="idref" href="Norm.html#t:179"><span class="id" title="variable">t</span></a><br/>
| (<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">x</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a><span class="id" title="var">s</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#::list_scope:x_'::'_x"><span class="id" title="notation">::</span></a><span class="id" title="var">ss'</span>) ⇒ <a class="idref" href="Norm.html#msubst:180"><span class="id" title="definition">msubst</span></a> <span class="id" title="var">ss'</span> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><span class="id" title="var">x</span><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><span class="id" title="var">s</span><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a><a class="idref" href="Norm.html#t:179"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a><br/>
<span class="id" title="keyword">end</span>.<br/>
</div>

<div class="doc">
We need similar machinery to talk about repeated extension of a
    typing context using a list of (identifier, type) pairs, which we
    call a <i>type assignment</i>. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Definition</span> <a id="tass" class="idref" href="#tass"><span class="id" title="definition">tass</span></a> := <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#list"><span class="id" title="inductive">list</span></a> (<a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac<sub>4</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="Norm.html#ty"><span class="id" title="inductive">ty</span></a>).<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Fixpoint</span> <a id="mupdate" class="idref" href="#mupdate"><span class="id" title="definition">mupdate</span></a> (<a id="Gamma:182" class="idref" href="#Gamma:182"><span class="id" title="binder">Gamma</span></a> : <a class="idref" href="Norm.html#context"><span class="id" title="definition">context</span></a>) (<a id="xts:183" class="idref" href="#xts:183"><span class="id" title="binder">xts</span></a> : <a class="idref" href="Norm.html#tass"><span class="id" title="definition">tass</span></a>) :=<br/>
&nbsp;&nbsp;<span class="id" title="keyword">match</span> <a class="idref" href="Norm.html#xts:183"><span class="id" title="variable">xts</span></a> <span class="id" title="keyword">with</span><br/>
&nbsp;&nbsp;| <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nil"><span class="id" title="constructor">nil</span></a> ⇒ <a class="idref" href="Norm.html#Gamma:182"><span class="id" title="variable">Gamma</span></a><br/>
&nbsp;&nbsp;| (<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">x</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a><span class="id" title="var">v</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#::list_scope:x_'::'_x"><span class="id" title="notation">::</span></a><span class="id" title="var">xts'</span>) ⇒ <span class="id" title="definition">update</span> (<a class="idref" href="Norm.html#mupdate:184"><span class="id" title="definition">mupdate</span></a> <a class="idref" href="Norm.html#Gamma:182"><span class="id" title="variable">Gamma</span></a> <span class="id" title="var">xts'</span>) <span class="id" title="var">x</span> <span class="id" title="var">v</span><br/>
&nbsp;&nbsp;<span class="id" title="keyword">end</span>.<br/>
</div>

<div class="doc">
We will need some simple operations that work uniformly on
    environments and type assigments 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Fixpoint</span> <a id="lookup" class="idref" href="#lookup"><span class="id" title="definition">lookup</span></a> {<a id="X:186" class="idref" href="#X:186"><span class="id" title="binder">X</span></a>:<span class="id" title="keyword">Set</span>} (<a id="k:187" class="idref" href="#k:187"><span class="id" title="binder">k</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a>) (<a id="l:188" class="idref" href="#l:188"><span class="id" title="binder">l</span></a> : <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#list"><span class="id" title="inductive">list</span></a> (<a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac<sub>4</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="Norm.html#X:186"><span class="id" title="variable">X</span></a>))<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#option"><span class="id" title="inductive">option</span></a> <a class="idref" href="Norm.html#X:186"><span class="id" title="variable">X</span></a> :=<br/>
&nbsp;&nbsp;<span class="id" title="keyword">match</span> <a class="idref" href="Norm.html#l:188"><span class="id" title="variable">l</span></a> <span class="id" title="keyword">with</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;| <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nil"><span class="id" title="constructor">nil</span></a> ⇒ <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#None"><span class="id" title="constructor">None</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;| <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">j</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a><span class="id" title="var">x</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#::list_scope:x_'::'_x"><span class="id" title="notation">::</span></a> <span class="id" title="var">l'</span> ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">if</span> <span class="id" title="definition">eqb_string</span> <span class="id" title="var">j</span> <a class="idref" href="Norm.html#k:187"><span class="id" title="variable">k</span></a> <span class="id" title="keyword">then</span> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#Some"><span class="id" title="constructor">Some</span></a> <span class="id" title="var">x</span> <span class="id" title="keyword">else</span> <a class="idref" href="Norm.html#lookup:189"><span class="id" title="definition">lookup</span></a> <a class="idref" href="Norm.html#k:187"><span class="id" title="variable">k</span></a> <span class="id" title="var">l'</span><br/>
&nbsp;&nbsp;<span class="id" title="keyword">end</span>.<br/><hr class='doublespaceincode'/>
<span class="id" title="keyword">Fixpoint</span> <a id="drop" class="idref" href="#drop"><span class="id" title="definition">drop</span></a> {<a id="X:191" class="idref" href="#X:191"><span class="id" title="binder">X</span></a>:<span class="id" title="keyword">Set</span>} (<a id="n:192" class="idref" href="#n:192"><span class="id" title="binder">n</span></a>:<a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a>) (<a id="nxs:193" class="idref" href="#nxs:193"><span class="id" title="binder">nxs</span></a>:<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#list"><span class="id" title="inductive">list</span></a> (<a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac<sub>4</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="Norm.html#X:191"><span class="id" title="variable">X</span></a>))<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#list"><span class="id" title="inductive">list</span></a> (<a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac<sub>4</sub>"><span class="id" title="notation">×</span></a> <a class="idref" href="Norm.html#X:191"><span class="id" title="variable">X</span></a>) :=<br/>
&nbsp;&nbsp;<span class="id" title="keyword">match</span> <a class="idref" href="Norm.html#nxs:193"><span class="id" title="variable">nxs</span></a> <span class="id" title="keyword">with</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;| <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nil"><span class="id" title="constructor">nil</span></a> ⇒ <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nil"><span class="id" title="constructor">nil</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;| (<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">n'</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a><span class="id" title="var">x</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#::list_scope:x_'::'_x"><span class="id" title="notation">::</span></a><span class="id" title="var">nxs'</span>) ⇒<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">if</span> <span class="id" title="definition">eqb_string</span> <span class="id" title="var">n'</span> <a class="idref" href="Norm.html#n:192"><span class="id" title="variable">n</span></a> <span class="id" title="keyword">then</span> <a class="idref" href="Norm.html#drop:194"><span class="id" title="definition">drop</span></a> <a class="idref" href="Norm.html#n:192"><span class="id" title="variable">n</span></a> <span class="id" title="var">nxs'</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">else</span> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">n'</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a><span class="id" title="var">x</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#::list_scope:x_'::'_x"><span class="id" title="notation">::(</span></a><a class="idref" href="Norm.html#drop:194"><span class="id" title="definition">drop</span></a> <a class="idref" href="Norm.html#n:192"><span class="id" title="variable">n</span></a> <span class="id" title="var">nxs'</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#::list_scope:x_'::'_x"><span class="id" title="notation">)</span></a><br/>
&nbsp;&nbsp;<span class="id" title="keyword">end</span>.<br/>
</div>

<div class="doc">
An <i>instantiation</i> combines a type assignment and a value
    environment with the same domains, where corresponding elements are
    in R. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Inductive</span> <a id="instantiation" class="idref" href="#instantiation"><span class="id" title="inductive">instantiation</span></a> :  <a class="idref" href="Norm.html#tass"><span class="id" title="definition">tass</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#env"><span class="id" title="definition">env</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <span class="id" title="keyword">Prop</span> :=<br/>
| <a id="V_nil" class="idref" href="#V_nil"><span class="id" title="constructor">V_nil</span></a> :<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#instantiation:196"><span class="id" title="inductive">instantiation</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nil"><span class="id" title="constructor">nil</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nil"><span class="id" title="constructor">nil</span></a><br/>
| <a id="V_cons" class="idref" href="#V_cons"><span class="id" title="constructor">V_cons</span></a> : <span class="id" title="keyword">∀</span> <a id="x:198" class="idref" href="#x:198"><span class="id" title="binder">x</span></a> <a id="T:199" class="idref" href="#T:199"><span class="id" title="binder">T</span></a> <a id="v:200" class="idref" href="#v:200"><span class="id" title="binder">v</span></a> <a id="c:201" class="idref" href="#c:201"><span class="id" title="binder">c</span></a> <a id="e:202" class="idref" href="#e:202"><span class="id" title="binder">e</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#value"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#v:200"><span class="id" title="variable">v</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <a class="idref" href="Norm.html#T:199"><span class="id" title="variable">T</span></a> <a class="idref" href="Norm.html#v:200"><span class="id" title="variable">v</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#instantiation:196"><span class="id" title="inductive">instantiation</span></a> <a class="idref" href="Norm.html#c:201"><span class="id" title="variable">c</span></a> <a class="idref" href="Norm.html#e:202"><span class="id" title="variable">e</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#instantiation:196"><span class="id" title="inductive">instantiation</span></a> (<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#x:198"><span class="id" title="variable">x</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a><a class="idref" href="Norm.html#T:199"><span class="id" title="variable">T</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#::list_scope:x_'::'_x"><span class="id" title="notation">::</span></a><a class="idref" href="Norm.html#c:201"><span class="id" title="variable">c</span></a>) (<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#x:198"><span class="id" title="variable">x</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a><a class="idref" href="Norm.html#v:200"><span class="id" title="variable">v</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#::list_scope:x_'::'_x"><span class="id" title="notation">::</span></a><a class="idref" href="Norm.html#e:202"><span class="id" title="variable">e</span></a>).<br/>
</div>

<div class="doc">
We now proceed to prove various properties of these definitions. 
</div>

<div class="doc">
<a id="lab466"></a><h3 class="section">More Substitution Facts</h3>

<div class="paragraph"> </div>

 First we need some additional lemmas on (ordinary) substitution. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="vacuous_substitution" class="idref" href="#vacuous_substitution"><span class="id" title="lemma">vacuous_substitution</span></a> : <span class="id" title="keyword">∀</span>  <a id="t:203" class="idref" href="#t:203"><span class="id" title="binder">t</span></a> <a id="x:204" class="idref" href="#x:204"><span class="id" title="binder">x</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#63a68285c81db8f9bc456233bb9ed181"><span class="id" title="notation">¬</span></a> <a class="idref" href="Norm.html#appears_free_in"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:204"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#t:203"><span class="id" title="variable">t</span></a>  <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">∀</span> <a id="t':205" class="idref" href="#t':205"><span class="id" title="binder">t'</span></a>, <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:204"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#t':205"><span class="id" title="variable">t'</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a><a class="idref" href="Norm.html#t:203"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="Norm.html#t:203"><span class="id" title="variable">t</span></a>.<br/>
<div class="togglescript" id="proofcontrol14" onclick="toggleDisplay('proof14');toggleDisplay('proofcontrol14')"><span class="show"></span></div>
<div class="proofscript" id="proof14" onclick="toggleDisplay('proof14');toggleDisplay('proofcontrol14')">
<span class="id" title="keyword">Proof</span> <span class="id" title="keyword">with</span> <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
</div>

<br/>
<span class="id" title="keyword">Lemma</span> <a id="subst_closed" class="idref" href="#subst_closed"><span class="id" title="lemma">subst_closed</span></a>: <span class="id" title="keyword">∀</span> <a id="t:206" class="idref" href="#t:206"><span class="id" title="binder">t</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#closed"><span class="id" title="definition">closed</span></a> <a class="idref" href="Norm.html#t:206"><span class="id" title="variable">t</span></a>  <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">∀</span> <a id="x:207" class="idref" href="#x:207"><span class="id" title="binder">x</span></a> <a id="t':208" class="idref" href="#t':208"><span class="id" title="binder">t'</span></a>, <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:207"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#t':208"><span class="id" title="variable">t'</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a><a class="idref" href="Norm.html#t:206"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="Norm.html#t:206"><span class="id" title="variable">t</span></a>.<br/>
<div class="togglescript" id="proofcontrol15" onclick="toggleDisplay('proof15');toggleDisplay('proofcontrol15')"><span class="show"></span></div>
<div class="proofscript" id="proof15" onclick="toggleDisplay('proof15');toggleDisplay('proofcontrol15')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span>. <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#vacuous_substitution"><span class="id" title="axiom">vacuous_substitution</span></a>. <span class="id" title="tactic">apply</span> <span class="id" title="var">H</span>. <span class="id" title="keyword">Qed</span>.<br/>
</div>

<br/>
<span class="id" title="keyword">Lemma</span> <a id="subst_not_afi" class="idref" href="#subst_not_afi"><span class="id" title="lemma">subst_not_afi</span></a> : <span class="id" title="keyword">∀</span> <a id="t:209" class="idref" href="#t:209"><span class="id" title="binder">t</span></a> <a id="x:210" class="idref" href="#x:210"><span class="id" title="binder">x</span></a> <a id="v:211" class="idref" href="#v:211"><span class="id" title="binder">v</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#closed"><span class="id" title="definition">closed</span></a> <a class="idref" href="Norm.html#v:211"><span class="id" title="variable">v</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a>  <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#63a68285c81db8f9bc456233bb9ed181"><span class="id" title="notation">¬</span></a> <a class="idref" href="Norm.html#appears_free_in"><span class="id" title="inductive">appears_free_in</span></a> <a class="idref" href="Norm.html#x:210"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:210"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#v:211"><span class="id" title="variable">v</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a><a class="idref" href="Norm.html#t:209"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a>.<br/>
<div class="togglescript" id="proofcontrol16" onclick="toggleDisplay('proof16');toggleDisplay('proofcontrol16')"><span class="show"></span></div>
<div class="proofscript" id="proof16" onclick="toggleDisplay('proof16');toggleDisplay('proofcontrol16')">
<span class="id" title="keyword">Proof</span> <span class="id" title="keyword">with</span> <span class="id" title="tactic">eauto</span>. <span class="comment">(*&nbsp;rather&nbsp;slow&nbsp;this&nbsp;way&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="id" title="tactic">unfold</span> <a class="idref" href="Norm.html#closed"><span class="id" title="definition">closed</span></a>, <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#not"><span class="id" title="definition">not</span></a>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">t</span>; <span class="id" title="tactic">intros</span> <span class="id" title="var">x</span> <span class="id" title="var">v</span> <span class="id" title="var">P</span> <span class="id" title="var">A</span>; <span class="id" title="tactic">simpl</span> <span class="id" title="tactic">in</span> <span class="id" title="var">A</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;- <span class="comment">(*&nbsp;var&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">x</span> <span class="id" title="var">s</span>)...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">A</span>; <span class="id" title="tactic">subst</span>. <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;- <span class="comment">(*&nbsp;app&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">A</span>; <span class="id" title="tactic">subst</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;- <span class="comment">(*&nbsp;abs&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">x</span> <span class="id" title="var">s</span>)...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">inversion</span> <span class="id" title="var">A</span>; <span class="id" title="tactic">subst</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">inversion</span> <span class="id" title="var">A</span>; <span class="id" title="tactic">subst</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;- <span class="comment">(*&nbsp;tru&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">A</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;- <span class="comment">(*&nbsp;fls&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">A</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;- <span class="comment">(*&nbsp;test&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">A</span>; <span class="id" title="tactic">subst</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;- <span class="comment">(*&nbsp;pair&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">A</span>; <span class="id" title="tactic">subst</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;- <span class="comment">(*&nbsp;fst&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">A</span>; <span class="id" title="tactic">subst</span>...<br/>
&nbsp;&nbsp;&nbsp;&nbsp;- <span class="comment">(*&nbsp;snd&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">A</span>; <span class="id" title="tactic">subst</span>...<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<br/>
<span class="id" title="keyword">Lemma</span> <a id="duplicate_subst" class="idref" href="#duplicate_subst"><span class="id" title="lemma">duplicate_subst</span></a> : <span class="id" title="keyword">∀</span> <a id="t':212" class="idref" href="#t':212"><span class="id" title="binder">t'</span></a> <a id="x:213" class="idref" href="#x:213"><span class="id" title="binder">x</span></a> <a id="t:214" class="idref" href="#t:214"><span class="id" title="binder">t</span></a> <a id="v:215" class="idref" href="#v:215"><span class="id" title="binder">v</span></a>,<br/>
&nbsp;&nbsp;<a class="idref" href="Norm.html#closed"><span class="id" title="definition">closed</span></a> <a class="idref" href="Norm.html#v:215"><span class="id" title="variable">v</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:213"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#t:214"><span class="id" title="variable">t</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:213"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#v:215"><span class="id" title="variable">v</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a><a class="idref" href="Norm.html#t':212"><span class="id" title="variable">t'</span></a><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:213"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#v:215"><span class="id" title="variable">v</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a><a class="idref" href="Norm.html#t':212"><span class="id" title="variable">t'</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a>.<br/>
<div class="togglescript" id="proofcontrol17" onclick="toggleDisplay('proof17');toggleDisplay('proofcontrol17')"><span class="show"></span></div>
<div class="proofscript" id="proof17" onclick="toggleDisplay('proof17');toggleDisplay('proofcontrol17')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span>. <span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#vacuous_substitution"><span class="id" title="axiom">vacuous_substitution</span></a>. <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#subst_not_afi"><span class="id" title="lemma">subst_not_afi</span></a>. <span class="id" title="tactic">assumption</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<br/>
<span class="id" title="keyword">Lemma</span> <a id="swap_subst" class="idref" href="#swap_subst"><span class="id" title="lemma">swap_subst</span></a> : <span class="id" title="keyword">∀</span> <a id="t:216" class="idref" href="#t:216"><span class="id" title="binder">t</span></a> <a id="x:217" class="idref" href="#x:217"><span class="id" title="binder">x</span></a> <a id="x<sub>1</sub>:218" class="idref" href="#x<sub>1</sub>:218"><span class="id" title="binder">x<sub>1</sub></span></a> <a id="v:219" class="idref" href="#v:219"><span class="id" title="binder">v</span></a> <a id="v<sub>1</sub>:220" class="idref" href="#v<sub>1</sub>:220"><span class="id" title="binder">v<sub>1</sub></span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#x:217"><span class="id" title="variable">x</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'&lt;&gt;'_x"><span class="id" title="notation">≠</span></a> <a class="idref" href="Norm.html#x<sub>1</sub>:218"><span class="id" title="variable">x<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#closed"><span class="id" title="definition">closed</span></a> <a class="idref" href="Norm.html#v:219"><span class="id" title="variable">v</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#closed"><span class="id" title="definition">closed</span></a> <a class="idref" href="Norm.html#v<sub>1</sub>:220"><span class="id" title="variable">v<sub>1</sub></span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x<sub>1</sub>:218"><span class="id" title="variable">x<sub>1</sub></span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#v<sub>1</sub>:220"><span class="id" title="variable">v<sub>1</sub></span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:217"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#v:219"><span class="id" title="variable">v</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a><a class="idref" href="Norm.html#t:216"><span class="id" title="variable">t</span></a><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:217"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#v:219"><span class="id" title="variable">v</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x<sub>1</sub>:218"><span class="id" title="variable">x<sub>1</sub></span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#v<sub>1</sub>:220"><span class="id" title="variable">v<sub>1</sub></span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a><a class="idref" href="Norm.html#t:216"><span class="id" title="variable">t</span></a><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a>.<br/>
<div class="togglescript" id="proofcontrol18" onclick="toggleDisplay('proof18');toggleDisplay('proofcontrol18')"><span class="show"></span></div>
<div class="proofscript" id="proof18" onclick="toggleDisplay('proof18');toggleDisplay('proofcontrol18')">
<span class="id" title="keyword">Proof</span> <span class="id" title="keyword">with</span> <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">t</span>; <span class="id" title="tactic">intros</span>; <span class="id" title="tactic">simpl</span>.<br/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;var&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">x</span> <span class="id" title="var">s</span>); <span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">x<sub>1</sub></span> <span class="id" title="var">s</span>).<br/>
&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">subst</span>. <span class="id" title="var">exfalso</span>...<br/>
&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">subst</span>. <span class="id" title="tactic">simpl</span>. <span class="id" title="tactic">rewrite</span> &lt;- <span class="id" title="lemma">eqb_string_refl</span>. <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#subst_closed"><span class="id" title="lemma">subst_closed</span></a>...<br/>
&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">subst</span>. <span class="id" title="tactic">simpl</span>. <span class="id" title="tactic">rewrite</span> &lt;- <span class="id" title="lemma">eqb_string_refl</span>. <span class="id" title="tactic">rewrite</span> <a class="idref" href="Norm.html#subst_closed"><span class="id" title="lemma">subst_closed</span></a>...<br/>
&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">simpl</span>. <span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">false_eqb_string</span>... <span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">false_eqb_string</span>...<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
</div>
</div>

<div class="doc">
<a id="lab467"></a><h3 class="section">Properties of Multi-Substitutions</h3>

</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="msubst_closed" class="idref" href="#msubst_closed"><span class="id" title="lemma">msubst_closed</span></a>: <span class="id" title="keyword">∀</span> <a id="t:221" class="idref" href="#t:221"><span class="id" title="binder">t</span></a>, <a class="idref" href="Norm.html#closed"><span class="id" title="definition">closed</span></a> <a class="idref" href="Norm.html#t:221"><span class="id" title="variable">t</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <span class="id" title="keyword">∀</span> <a id="ss:222" class="idref" href="#ss:222"><span class="id" title="binder">ss</span></a>, <a class="idref" href="Norm.html#msubst"><span class="id" title="definition">msubst</span></a> <a class="idref" href="Norm.html#ss:222"><span class="id" title="variable">ss</span></a> <a class="idref" href="Norm.html#t:221"><span class="id" title="variable">t</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="Norm.html#t:221"><span class="id" title="variable">t</span></a>.<br/>
<div class="togglescript" id="proofcontrol19" onclick="toggleDisplay('proof19');toggleDisplay('proofcontrol19')"><span class="show"></span></div>
<div class="proofscript" id="proof19" onclick="toggleDisplay('proof19');toggleDisplay('proofcontrol19')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">ss</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">reflexivity</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">a</span>. <span class="id" title="tactic">simpl</span>. <span class="id" title="tactic">rewrite</span> <a class="idref" href="Norm.html#subst_closed"><span class="id" title="lemma">subst_closed</span></a>; <span class="id" title="tactic">assumption</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>
</div>

<div class="doc">
Closed environments are those that contain only closed terms. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Fixpoint</span> <a id="closed_env" class="idref" href="#closed_env"><span class="id" title="definition">closed_env</span></a> (<a id="env:223" class="idref" href="#env:223"><span class="id" title="binder">env</span></a>:<a class="idref" href="Norm.html#env"><span class="id" title="definition">env</span></a>) :=<br/>
&nbsp;&nbsp;<span class="id" title="keyword">match</span> <a class="idref" href="Norm.html#env:223"><span class="id" title="variable">env</span></a> <span class="id" title="keyword">with</span><br/>
&nbsp;&nbsp;| <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nil"><span class="id" title="constructor">nil</span></a> ⇒ <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#True"><span class="id" title="inductive">True</span></a><br/>
&nbsp;&nbsp;| <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">x</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a><span class="id" title="var">t</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#::list_scope:x_'::'_x"><span class="id" title="notation">::</span></a><span class="id" title="var">env'</span> ⇒ <a class="idref" href="Norm.html#closed"><span class="id" title="definition">closed</span></a> <span class="id" title="var">t</span> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#ba2b0e492d2b4675a0acf3ea92aabadd"><span class="id" title="notation">∧</span></a> <a class="idref" href="Norm.html#closed_env:224"><span class="id" title="definition">closed_env</span></a> <span class="id" title="var">env'</span><br/>
&nbsp;&nbsp;<span class="id" title="keyword">end</span>.<br/>
</div>

<div class="doc">
Next come a series of lemmas charcterizing how <span class="inlinecode"><span class="id" title="var">msubst</span></span> of closed terms
    distributes over <span class="inlinecode"><span class="id" title="tactic">subst</span></span> and over each term form 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="subst_msubst" class="idref" href="#subst_msubst"><span class="id" title="lemma">subst_msubst</span></a>: <span class="id" title="keyword">∀</span> <a id="env:226" class="idref" href="#env:226"><span class="id" title="binder">env</span></a> <a id="x:227" class="idref" href="#x:227"><span class="id" title="binder">x</span></a> <a id="v:228" class="idref" href="#v:228"><span class="id" title="binder">v</span></a> <a id="t:229" class="idref" href="#t:229"><span class="id" title="binder">t</span></a>, <a class="idref" href="Norm.html#closed"><span class="id" title="definition">closed</span></a> <a class="idref" href="Norm.html#v:228"><span class="id" title="variable">v</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#closed_env"><span class="id" title="definition">closed_env</span></a> <a class="idref" href="Norm.html#env:226"><span class="id" title="variable">env</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#msubst"><span class="id" title="definition">msubst</span></a> <a class="idref" href="Norm.html#env:226"><span class="id" title="variable">env</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:227"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#v:228"><span class="id" title="variable">v</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a><a class="idref" href="Norm.html#t:229"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">[</span></a><a class="idref" href="Norm.html#x:227"><span class="id" title="variable">x</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">:=</span></a><a class="idref" href="Norm.html#v:228"><span class="id" title="variable">v</span></a><a class="idref" href="Norm.html#83dbd6b289334c93dbc0440277d51136"><span class="id" title="notation">]</span></a>  <a class="idref" href="Norm.html#45164e50103cb4f5a6f30f892835b135"><span class="id" title="notation">{</span></a> <a class="idref" href="Norm.html#msubst"><span class="id" title="definition">msubst</span></a> (<a class="idref" href="Norm.html#drop"><span class="id" title="definition">drop</span></a> <a class="idref" href="Norm.html#x:227"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#env:226"><span class="id" title="variable">env</span></a>) <a class="idref" href="Norm.html#t:229"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#45164e50103cb4f5a6f30f892835b135"><span class="id" title="notation">}</span></a>  <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> .<br/>
<div class="togglescript" id="proofcontrol20" onclick="toggleDisplay('proof20');toggleDisplay('proofcontrol20')"><span class="show"></span></div>
<div class="proofscript" id="proof20" onclick="toggleDisplay('proof20');toggleDisplay('proofcontrol20')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">env0</span>; <span class="id" title="tactic">intros</span>; <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">a</span>. <span class="id" title="tactic">simpl</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">H<sub>0</sub></span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">s</span> <span class="id" title="var">x</span>).<br/>
&nbsp;&nbsp;- <span class="id" title="tactic">subst</span>. <span class="id" title="tactic">rewrite</span> <a class="idref" href="Norm.html#duplicate_subst"><span class="id" title="lemma">duplicate_subst</span></a>; <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;- <span class="id" title="tactic">simpl</span>. <span class="id" title="tactic">rewrite</span> <a class="idref" href="Norm.html#swap_subst"><span class="id" title="axiom">swap_subst</span></a>; <span class="id" title="tactic">eauto</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<br/>
<span class="id" title="keyword">Lemma</span> <a id="msubst_var" class="idref" href="#msubst_var"><span class="id" title="lemma">msubst_var</span></a>:  <span class="id" title="keyword">∀</span> <a id="ss:230" class="idref" href="#ss:230"><span class="id" title="binder">ss</span></a> <a id="x:231" class="idref" href="#x:231"><span class="id" title="binder">x</span></a>, <a class="idref" href="Norm.html#closed_env"><span class="id" title="definition">closed_env</span></a> <a class="idref" href="Norm.html#ss:230"><span class="id" title="variable">ss</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#msubst"><span class="id" title="definition">msubst</span></a> <a class="idref" href="Norm.html#ss:230"><span class="id" title="variable">ss</span></a> (<a class="idref" href="Norm.html#tm_var"><span class="id" title="constructor">tm_var</span></a> <a class="idref" href="Norm.html#x:231"><span class="id" title="variable">x</span></a>) <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a><br/>
&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">match</span> <a class="idref" href="Norm.html#lookup"><span class="id" title="definition">lookup</span></a> <a class="idref" href="Norm.html#x:231"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#ss:230"><span class="id" title="variable">ss</span></a> <span class="id" title="keyword">with</span><br/>
&nbsp;&nbsp;&nbsp;| <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#Some"><span class="id" title="constructor">Some</span></a> <span class="id" title="var">t</span> ⇒ <span class="id" title="var">t</span><br/>
&nbsp;&nbsp;&nbsp;| <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#None"><span class="id" title="constructor">None</span></a> ⇒ <a class="idref" href="Norm.html#tm_var"><span class="id" title="constructor">tm_var</span></a> <a class="idref" href="Norm.html#x:231"><span class="id" title="variable">x</span></a><br/>
&nbsp;&nbsp;<span class="id" title="keyword">end</span>.<br/>
<div class="togglescript" id="proofcontrol21" onclick="toggleDisplay('proof21');toggleDisplay('proofcontrol21')"><span class="show"></span></div>
<div class="proofscript" id="proof21" onclick="toggleDisplay('proof21');toggleDisplay('proofcontrol21')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">ss</span>; <span class="id" title="tactic">intros</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">reflexivity</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">a</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">simpl</span>. <span class="id" title="tactic">destruct</span> (<span class="id" title="definition">eqb_string</span> <span class="id" title="var">s</span> <span class="id" title="var">x</span>).<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#msubst_closed"><span class="id" title="lemma">msubst_closed</span></a>. <span class="id" title="tactic">inversion</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <span class="id" title="var">IHss</span>. <span class="id" title="tactic">inversion</span> <span class="id" title="var">H</span>; <span class="id" title="tactic">auto</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<br/>
<span class="id" title="keyword">Lemma</span> <a id="msubst_abs" class="idref" href="#msubst_abs"><span class="id" title="lemma">msubst_abs</span></a>: <span class="id" title="keyword">∀</span> <a id="ss:232" class="idref" href="#ss:232"><span class="id" title="binder">ss</span></a> <a id="x:233" class="idref" href="#x:233"><span class="id" title="binder">x</span></a> <a id="T:234" class="idref" href="#T:234"><span class="id" title="binder">T</span></a> <a id="t:235" class="idref" href="#t:235"><span class="id" title="binder">t</span></a>,<br/>
&nbsp;&nbsp;<a class="idref" href="Norm.html#msubst"><span class="id" title="definition">msubst</span></a> <a class="idref" href="Norm.html#ss:232"><span class="id" title="variable">ss</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">\</span></a> <a class="idref" href="Norm.html#x:233"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">:</span></a> <a class="idref" href="Norm.html#T:234"><span class="id" title="variable">T</span></a><a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#t:235"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#x:233"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">:</span></a> <a class="idref" href="Norm.html#T:234"><span class="id" title="variable">T</span></a><a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#45164e50103cb4f5a6f30f892835b135"><span class="id" title="notation">{</span></a><a class="idref" href="Norm.html#msubst"><span class="id" title="definition">msubst</span></a> (<a class="idref" href="Norm.html#drop"><span class="id" title="definition">drop</span></a> <a class="idref" href="Norm.html#x:233"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#ss:232"><span class="id" title="variable">ss</span></a>) <a class="idref" href="Norm.html#t:235"><span class="id" title="variable">t</span></a><a class="idref" href="Norm.html#45164e50103cb4f5a6f30f892835b135"><span class="id" title="notation">}</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a>.<br/>
<div class="togglescript" id="proofcontrol22" onclick="toggleDisplay('proof22');toggleDisplay('proofcontrol22')"><span class="show"></span></div>
<div class="proofscript" id="proof22" onclick="toggleDisplay('proof22');toggleDisplay('proofcontrol22')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">ss</span>; <span class="id" title="tactic">intros</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">reflexivity</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">a</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">simpl</span>. <span class="id" title="tactic">destruct</span> (<span class="id" title="definition">eqb_string</span> <span class="id" title="var">s</span> <span class="id" title="var">x</span>); <span class="id" title="tactic">simpl</span>; <span class="id" title="tactic">auto</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<br/>
<span class="id" title="keyword">Lemma</span> <a id="msubst_app" class="idref" href="#msubst_app"><span class="id" title="lemma">msubst_app</span></a> : <span class="id" title="keyword">∀</span> <a id="ss:236" class="idref" href="#ss:236"><span class="id" title="binder">ss</span></a> <a id="t<sub>1</sub>:237" class="idref" href="#t<sub>1</sub>:237"><span class="id" title="binder">t<sub>1</sub></span></a> <a id="t<sub>2</sub>:238" class="idref" href="#t<sub>2</sub>:238"><span class="id" title="binder">t<sub>2</sub></span></a>, <br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#msubst"><span class="id" title="definition">msubst</span></a> <a class="idref" href="Norm.html#ss:236"><span class="id" title="variable">ss</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:237"><span class="id" title="variable">t<sub>1</sub></span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:238"><span class="id" title="variable">t<sub>2</sub></span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#45164e50103cb4f5a6f30f892835b135"><span class="id" title="notation">{</span></a><a class="idref" href="Norm.html#msubst"><span class="id" title="definition">msubst</span></a> <a class="idref" href="Norm.html#ss:236"><span class="id" title="variable">ss</span></a> <a class="idref" href="Norm.html#t<sub>1</sub>:237"><span class="id" title="variable">t<sub>1</sub></span></a><a class="idref" href="Norm.html#45164e50103cb4f5a6f30f892835b135"><span class="id" title="notation">}</span></a> <a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#45164e50103cb4f5a6f30f892835b135"><span class="id" title="notation">{</span></a><a class="idref" href="Norm.html#msubst"><span class="id" title="definition">msubst</span></a> <a class="idref" href="Norm.html#ss:236"><span class="id" title="variable">ss</span></a> <a class="idref" href="Norm.html#t<sub>2</sub>:238"><span class="id" title="variable">t<sub>2</sub></span></a><a class="idref" href="Norm.html#45164e50103cb4f5a6f30f892835b135"><span class="id" title="notation">}</span></a><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a>.<br/>
<div class="togglescript" id="proofcontrol23" onclick="toggleDisplay('proof23');toggleDisplay('proofcontrol23')"><span class="show"></span></div>
<div class="proofscript" id="proof23" onclick="toggleDisplay('proof23');toggleDisplay('proofcontrol23')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">ss</span>; <span class="id" title="tactic">intros</span>.<br/>
&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">reflexivity</span>.<br/>
&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">a</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">simpl</span>. <span class="id" title="tactic">rewrite</span> &lt;- <span class="id" title="var">IHss</span>. <span class="id" title="tactic">auto</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>
</div>

<div class="doc">
You'll need similar functions for the other term constructors. 
</div>
<div class="code">

<br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
</div>

<div class="doc">
<a id="lab468"></a><h3 class="section">Properties of Multi-Extensions</h3>

<div class="paragraph"> </div>

 We need to connect the behavior of type assignments with that of
    their corresponding contexts. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="mupdate_lookup" class="idref" href="#mupdate_lookup"><span class="id" title="lemma">mupdate_lookup</span></a> : <span class="id" title="keyword">∀</span> (<a id="c:239" class="idref" href="#c:239"><span class="id" title="binder">c</span></a> : <a class="idref" href="Norm.html#tass"><span class="id" title="definition">tass</span></a>) (<a id="x:240" class="idref" href="#x:240"><span class="id" title="binder">x</span></a>:<a class="idref" href="http://coq.inria.fr/library//Coq.Strings.String.html#string"><span class="id" title="inductive">string</span></a>),<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#lookup"><span class="id" title="definition">lookup</span></a> <a class="idref" href="Norm.html#x:240"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#c:239"><span class="id" title="variable">c</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> (<a class="idref" href="Norm.html#mupdate"><span class="id" title="definition">mupdate</span></a> <span class="id" title="definition">empty</span> <a class="idref" href="Norm.html#c:239"><span class="id" title="variable">c</span></a>) <a class="idref" href="Norm.html#x:240"><span class="id" title="variable">x</span></a>.<br/>
<div class="togglescript" id="proofcontrol24" onclick="toggleDisplay('proof24');toggleDisplay('proofcontrol24')"><span class="show"></span></div>
<div class="proofscript" id="proof24" onclick="toggleDisplay('proof24');toggleDisplay('proofcontrol24')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">c</span>; <span class="id" title="tactic">intros</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> <span class="id" title="var">a</span>. <span class="id" title="tactic">unfold</span> <a class="idref" href="Norm.html#lookup"><span class="id" title="definition">lookup</span></a>, <a class="idref" href="Norm.html#mupdate"><span class="id" title="definition">mupdate</span></a>, <span class="id" title="definition">update</span>, <span class="id" title="definition">t_update</span>. <span class="id" title="tactic">destruct</span> (<span class="id" title="definition">eqb_string</span> <span class="id" title="var">s</span> <span class="id" title="var">x</span>); <span class="id" title="tactic">auto</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<br/>
<span class="id" title="keyword">Lemma</span> <a id="mupdate_drop" class="idref" href="#mupdate_drop"><span class="id" title="lemma">mupdate_drop</span></a> : <span class="id" title="keyword">∀</span> (<a id="c:241" class="idref" href="#c:241"><span class="id" title="binder">c</span></a>: <a class="idref" href="Norm.html#tass"><span class="id" title="definition">tass</span></a>) <a id="Gamma:242" class="idref" href="#Gamma:242"><span class="id" title="binder">Gamma</span></a> <a id="x:243" class="idref" href="#x:243"><span class="id" title="binder">x</span></a> <a id="x':244" class="idref" href="#x':244"><span class="id" title="binder">x'</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#mupdate"><span class="id" title="definition">mupdate</span></a> <a class="idref" href="Norm.html#Gamma:242"><span class="id" title="variable">Gamma</span></a> (<a class="idref" href="Norm.html#drop"><span class="id" title="definition">drop</span></a> <a class="idref" href="Norm.html#x:243"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#c:241"><span class="id" title="variable">c</span></a>) <a class="idref" href="Norm.html#x':244"><span class="id" title="variable">x'</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <span class="id" title="keyword">if</span> <span class="id" title="definition">eqb_string</span> <a class="idref" href="Norm.html#x:243"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#x':244"><span class="id" title="variable">x'</span></a> <span class="id" title="keyword">then</span> <a class="idref" href="Norm.html#Gamma:242"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#x':244"><span class="id" title="variable">x'</span></a> <span class="id" title="keyword">else</span> <a class="idref" href="Norm.html#mupdate"><span class="id" title="definition">mupdate</span></a> <a class="idref" href="Norm.html#Gamma:242"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#c:241"><span class="id" title="variable">c</span></a> <a class="idref" href="Norm.html#x':244"><span class="id" title="variable">x'</span></a>.<br/>
<div class="togglescript" id="proofcontrol25" onclick="toggleDisplay('proof25');toggleDisplay('proofcontrol25')"><span class="show"></span></div>
<div class="proofscript" id="proof25" onclick="toggleDisplay('proof25');toggleDisplay('proofcontrol25')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">c</span>; <span class="id" title="tactic">intros</span>.<br/>
&nbsp;&nbsp;- <span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">x</span> <span class="id" title="var">x'</span>); <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;- <span class="id" title="tactic">destruct</span> <span class="id" title="var">a</span>. <span class="id" title="tactic">simpl</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">s</span> <span class="id" title="var">x</span>).<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">subst</span>. <span class="id" title="tactic">rewrite</span> <span class="id" title="var">IHc</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">unfold</span> <span class="id" title="definition">update</span>, <span class="id" title="definition">t_update</span>. <span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">x</span> <span class="id" title="var">x'</span>); <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">simpl</span>. <span class="id" title="tactic">unfold</span> <span class="id" title="definition">update</span>, <span class="id" title="definition">t_update</span>. <span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">s</span> <span class="id" title="var">x'</span>); <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">subst</span>. <span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">false_eqb_string</span>; <span class="id" title="tactic">congruence</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>
</div>

<div class="doc">
<a id="lab469"></a><h3 class="section">Properties of Instantiations</h3>

<div class="paragraph"> </div>

 These are strightforward. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="instantiation_domains_match" class="idref" href="#instantiation_domains_match"><span class="id" title="lemma">instantiation_domains_match</span></a>: <span class="id" title="keyword">∀</span> {<a id="c:245" class="idref" href="#c:245"><span class="id" title="binder">c</span></a>} {<a id="e:246" class="idref" href="#e:246"><span class="id" title="binder">e</span></a>},<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#instantiation"><span class="id" title="inductive">instantiation</span></a> <a class="idref" href="Norm.html#c:245"><span class="id" title="variable">c</span></a> <a class="idref" href="Norm.html#e:246"><span class="id" title="variable">e</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">∀</span> {<a id="x:247" class="idref" href="#x:247"><span class="id" title="binder">x</span></a>} {<a id="T:248" class="idref" href="#T:248"><span class="id" title="binder">T</span></a>},<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#lookup"><span class="id" title="definition">lookup</span></a> <a class="idref" href="Norm.html#x:247"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#c:245"><span class="id" title="variable">c</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#Some"><span class="id" title="constructor">Some</span></a> <a class="idref" href="Norm.html#T:248"><span class="id" title="variable">T</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#a883bdd010993579f99d60b3775bcf54"><span class="id" title="notation">∃</span></a> <a id="t:249" class="idref" href="#t:249"><span class="id" title="binder">t</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#a883bdd010993579f99d60b3775bcf54"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#lookup"><span class="id" title="definition">lookup</span></a> <a class="idref" href="Norm.html#x:247"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#e:246"><span class="id" title="variable">e</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#Some"><span class="id" title="constructor">Some</span></a> <a class="idref" href="Norm.html#t:249"><span class="id" title="variable">t</span></a>.<br/>
<div class="togglescript" id="proofcontrol26" onclick="toggleDisplay('proof26');toggleDisplay('proofcontrol26')"><span class="show"></span></div>
<div class="proofscript" id="proof26" onclick="toggleDisplay('proof26');toggleDisplay('proofcontrol26')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">c</span> <span class="id" title="var">e</span> <span class="id" title="var">V</span>. <span class="id" title="tactic">induction</span> <span class="id" title="var">V</span>; <span class="id" title="tactic">intros</span> <span class="id" title="var">x<sub>0</sub></span> <span class="id" title="var">T<sub>0</sub></span> <span class="id" title="var">C</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">solve_by_invert</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">simpl</span> <span class="id" title="tactic">in</span> ×.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="definition">eqb_string</span> <span class="id" title="var">x</span> <span class="id" title="var">x<sub>0</sub></span>); <span class="id" title="tactic">eauto</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<br/>
<span class="id" title="keyword">Lemma</span> <a id="instantiation_env_closed" class="idref" href="#instantiation_env_closed"><span class="id" title="lemma">instantiation_env_closed</span></a> : <span class="id" title="keyword">∀</span> <a id="c:250" class="idref" href="#c:250"><span class="id" title="binder">c</span></a> <a id="e:251" class="idref" href="#e:251"><span class="id" title="binder">e</span></a>,<br/>
&nbsp;&nbsp;<a class="idref" href="Norm.html#instantiation"><span class="id" title="inductive">instantiation</span></a> <a class="idref" href="Norm.html#c:250"><span class="id" title="variable">c</span></a> <a class="idref" href="Norm.html#e:251"><span class="id" title="variable">e</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#closed_env"><span class="id" title="definition">closed_env</span></a> <a class="idref" href="Norm.html#e:251"><span class="id" title="variable">e</span></a>.<br/>
<div class="togglescript" id="proofcontrol27" onclick="toggleDisplay('proof27');toggleDisplay('proofcontrol27')"><span class="show"></span></div>
<div class="proofscript" id="proof27" onclick="toggleDisplay('proof27');toggleDisplay('proofcontrol27')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">c</span> <span class="id" title="var">e</span> <span class="id" title="var">V</span>; <span class="id" title="tactic">induction</span> <span class="id" title="var">V</span>; <span class="id" title="tactic">intros</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">econstructor</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">unfold</span> <a class="idref" href="Norm.html#closed_env"><span class="id" title="definition">closed_env</span></a>. <span class="id" title="tactic">fold</span> <a class="idref" href="Norm.html#closed_env"><span class="id" title="definition">closed_env</span></a>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">split</span>; [|<span class="id" title="tactic">assumption</span>].<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#typable_empty__closed"><span class="id" title="lemma">typable_empty__closed</span></a>. <span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#R_typable_empty"><span class="id" title="lemma">R_typable_empty</span></a>. <span class="id" title="tactic">eauto</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<br/>
<span class="id" title="keyword">Lemma</span> <a id="instantiation_R" class="idref" href="#instantiation_R"><span class="id" title="lemma">instantiation_R</span></a> : <span class="id" title="keyword">∀</span> <a id="c:252" class="idref" href="#c:252"><span class="id" title="binder">c</span></a> <a id="e:253" class="idref" href="#e:253"><span class="id" title="binder">e</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#instantiation"><span class="id" title="inductive">instantiation</span></a> <a class="idref" href="Norm.html#c:252"><span class="id" title="variable">c</span></a> <a class="idref" href="Norm.html#e:253"><span class="id" title="variable">e</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">∀</span> <a id="x:254" class="idref" href="#x:254"><span class="id" title="binder">x</span></a> <a id="t:255" class="idref" href="#t:255"><span class="id" title="binder">t</span></a> <a id="T:256" class="idref" href="#T:256"><span class="id" title="binder">T</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#lookup"><span class="id" title="definition">lookup</span></a> <a class="idref" href="Norm.html#x:254"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#c:252"><span class="id" title="variable">c</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#Some"><span class="id" title="constructor">Some</span></a> <a class="idref" href="Norm.html#T:256"><span class="id" title="variable">T</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#lookup"><span class="id" title="definition">lookup</span></a> <a class="idref" href="Norm.html#x:254"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#e:253"><span class="id" title="variable">e</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#Some"><span class="id" title="constructor">Some</span></a> <a class="idref" href="Norm.html#t:255"><span class="id" title="variable">t</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <a class="idref" href="Norm.html#T:256"><span class="id" title="variable">T</span></a> <a class="idref" href="Norm.html#t:255"><span class="id" title="variable">t</span></a>.<br/>
<div class="togglescript" id="proofcontrol28" onclick="toggleDisplay('proof28');toggleDisplay('proofcontrol28')"><span class="show"></span></div>
<div class="proofscript" id="proof28" onclick="toggleDisplay('proof28');toggleDisplay('proofcontrol28')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">c</span> <span class="id" title="var">e</span> <span class="id" title="var">V</span>. <span class="id" title="tactic">induction</span> <span class="id" title="var">V</span>; <span class="id" title="tactic">intros</span> <span class="id" title="var">x'</span> <span class="id" title="var">t'</span> <span class="id" title="var">T'</span> <span class="id" title="var">G</span> <span class="id" title="var">E</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="var">solve_by_invert</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">unfold</span> <a class="idref" href="Norm.html#lookup"><span class="id" title="definition">lookup</span></a> <span class="id" title="tactic">in</span> ×. <span class="id" title="tactic">destruct</span> (<span class="id" title="definition">eqb_string</span> <span class="id" title="var">x</span> <span class="id" title="var">x'</span>).<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">inversion</span> <span class="id" title="var">G</span>; <span class="id" title="tactic">inversion</span> <span class="id" title="var">E</span>; <span class="id" title="tactic">subst</span>. <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eauto</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<br/>
<span class="id" title="keyword">Lemma</span> <a id="instantiation_drop" class="idref" href="#instantiation_drop"><span class="id" title="lemma">instantiation_drop</span></a> : <span class="id" title="keyword">∀</span> <a id="c:257" class="idref" href="#c:257"><span class="id" title="binder">c</span></a> <a id="env:258" class="idref" href="#env:258"><span class="id" title="binder">env</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#instantiation"><span class="id" title="inductive">instantiation</span></a> <a class="idref" href="Norm.html#c:257"><span class="id" title="variable">c</span></a> <a class="idref" href="Norm.html#env:258"><span class="id" title="variable">env</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">∀</span> <a id="x:259" class="idref" href="#x:259"><span class="id" title="binder">x</span></a>, <a class="idref" href="Norm.html#instantiation"><span class="id" title="inductive">instantiation</span></a> (<a class="idref" href="Norm.html#drop"><span class="id" title="definition">drop</span></a> <a class="idref" href="Norm.html#x:259"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#c:257"><span class="id" title="variable">c</span></a>) (<a class="idref" href="Norm.html#drop"><span class="id" title="definition">drop</span></a> <a class="idref" href="Norm.html#x:259"><span class="id" title="variable">x</span></a> <a class="idref" href="Norm.html#env:258"><span class="id" title="variable">env</span></a>).<br/>
<div class="togglescript" id="proofcontrol29" onclick="toggleDisplay('proof29');toggleDisplay('proofcontrol29')"><span class="show"></span></div>
<div class="proofscript" id="proof29" onclick="toggleDisplay('proof29');toggleDisplay('proofcontrol29')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">c</span> <span class="id" title="var">e</span> <span class="id" title="var">V</span>. <span class="id" title="tactic">induction</span> <span class="id" title="var">V</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">intros</span>. <span class="id" title="tactic">simpl</span>. <span class="id" title="tactic">constructor</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">intros</span>. <span class="id" title="tactic">unfold</span> <a class="idref" href="Norm.html#drop"><span class="id" title="definition">drop</span></a>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="definition">eqb_string</span> <span class="id" title="var">x</span> <span class="id" title="var">x<sub>0</sub></span>); <span class="id" title="tactic">auto</span>. <span class="id" title="tactic">constructor</span>; <span class="id" title="tactic">eauto</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>
</div>

<div class="doc">
<a id="lab470"></a><h3 class="section">Congruence Lemmas on Multistep</h3>

<div class="paragraph"> </div>

 We'll need just a few of these; add them as the demand arises. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="multistep_App2" class="idref" href="#multistep_App2"><span class="id" title="lemma">multistep_App2</span></a> : <span class="id" title="keyword">∀</span> <a id="v:260" class="idref" href="#v:260"><span class="id" title="binder">v</span></a> <a id="t:261" class="idref" href="#t:261"><span class="id" title="binder">t</span></a> <a id="t':262" class="idref" href="#t':262"><span class="id" title="binder">t'</span></a>,<br/>
&nbsp;&nbsp;<a class="idref" href="Norm.html#value"><span class="id" title="inductive">value</span></a> <a class="idref" href="Norm.html#v:260"><span class="id" title="variable">v</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#t:261"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#a781e4b1e2c022f0326182a9bd099911"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span></span></a> <a class="idref" href="Norm.html#t':262"><span class="id" title="variable">t'</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">)</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#v:260"><span class="id" title="variable">v</span></a> <a class="idref" href="Norm.html#t:261"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a> <a class="idref" href="Norm.html#a781e4b1e2c022f0326182a9bd099911"><span class="id" title="notation"><span class="nowrap"><span style='font-size:85%;'><span style='vertical-align:6%;'><span style='letter-spacing:-.2em;'>-</span><span style='letter-spacing:-.2em;'>-</span></span><span style='letter-spacing:-.2em;'>&gt;</span><span style='vertical-align:15%;'>*</span></span></span></span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">&lt;{</span></a> <a class="idref" href="Norm.html#v:260"><span class="id" title="variable">v</span></a> <a class="idref" href="Norm.html#t':262"><span class="id" title="variable">t'</span></a> <a class="idref" href="Norm.html#96e24cc1b3765f349012b832d1dd22ad"><span class="id" title="notation">}&gt;</span></a>.<br/>
<div class="togglescript" id="proofcontrol30" onclick="toggleDisplay('proof30');toggleDisplay('proofcontrol30')"><span class="show"></span></div>
<div class="proofscript" id="proof30" onclick="toggleDisplay('proof30');toggleDisplay('proofcontrol30')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">v</span> <span class="id" title="var">t</span> <span class="id" title="var">t'</span> <span class="id" title="var">V</span> <span class="id" title="var">STM</span>. <span class="id" title="tactic">induction</span> <span class="id" title="var">STM</span>.<br/>
&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <a class="idref" href="Smallstep.html#multi_refl"><span class="id" title="constructor">multi_refl</span></a>.<br/>
&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="Smallstep.html#multi_step"><span class="id" title="constructor">multi_step</span></a>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#ST_App2"><span class="id" title="constructor">ST_App2</span></a>; <span class="id" title="tactic">eauto</span>. <span class="id" title="tactic">auto</span>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<br/>
<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span><br/>
</div>

<div class="doc">
<a id="lab471"></a><h3 class="section">The R Lemma</h3>

<div class="paragraph"> </div>

 We can finally put everything together.

<div class="paragraph"> </div>

    The key lemma about preservation of typing under substitution can
    be lifted to multi-substitutions: 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="msubst_preserves_typing" class="idref" href="#msubst_preserves_typing"><span class="id" title="lemma">msubst_preserves_typing</span></a> : <span class="id" title="keyword">∀</span> <a id="c:263" class="idref" href="#c:263"><span class="id" title="binder">c</span></a> <a id="e:264" class="idref" href="#e:264"><span class="id" title="binder">e</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#instantiation"><span class="id" title="inductive">instantiation</span></a> <a class="idref" href="Norm.html#c:263"><span class="id" title="variable">c</span></a> <a class="idref" href="Norm.html#e:264"><span class="id" title="variable">e</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="keyword">∀</span> <a id="Gamma:265" class="idref" href="#Gamma:265"><span class="id" title="binder">Gamma</span></a> <a id="t:266" class="idref" href="#t:266"><span class="id" title="binder">t</span></a> <a id="S:267" class="idref" href="#S:267"><span class="id" title="binder">S</span></a>, <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#mupdate"><span class="id" title="definition">mupdate</span></a> <a class="idref" href="Norm.html#Gamma:265"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#c:263"><span class="id" title="variable">c</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:266"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#S:267"><span class="id" title="variable">S</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#Gamma:265"><span class="id" title="variable">Gamma</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#45164e50103cb4f5a6f30f892835b135"><span class="id" title="notation">{</span></a> <a class="idref" href="Norm.html#45164e50103cb4f5a6f30f892835b135"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#msubst"><span class="id" title="definition">msubst</span></a> <a class="idref" href="Norm.html#e:264"><span class="id" title="variable">e</span></a> <a class="idref" href="Norm.html#t:266"><span class="id" title="variable">t</span></a><a class="idref" href="Norm.html#45164e50103cb4f5a6f30f892835b135"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#45164e50103cb4f5a6f30f892835b135"><span class="id" title="notation">}</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#S:267"><span class="id" title="variable">S</span></a>.<br/>
<div class="togglescript" id="proofcontrol31" onclick="toggleDisplay('proof31');toggleDisplay('proofcontrol31')"><span class="show"></span></div>
<div class="proofscript" id="proof31" onclick="toggleDisplay('proof31');toggleDisplay('proofcontrol31')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> 1; <span class="id" title="tactic">intros</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">simpl</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H</span>. <span class="id" title="tactic">simpl</span>. <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">simpl</span> <span class="id" title="tactic">in</span> <span class="id" title="var">H<sub>2</sub></span>. <span class="id" title="tactic">simpl</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <span class="id" title="var">IHinstantiation</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#substitution_preserves_typing"><span class="id" title="lemma">substitution_preserves_typing</span></a>; <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> (<a class="idref" href="Norm.html#R_typable_empty"><span class="id" title="lemma">R_typable_empty</span></a> <span class="id" title="var">H<sub>0</sub></span>).<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>
</div>

<div class="doc">
And at long last, the main lemma. 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Lemma</span> <a id="msubst_R" class="idref" href="#msubst_R"><span class="id" title="lemma">msubst_R</span></a> : <span class="id" title="keyword">∀</span> <a id="c:268" class="idref" href="#c:268"><span class="id" title="binder">c</span></a> <a id="env:269" class="idref" href="#env:269"><span class="id" title="binder">env</span></a> <a id="t:270" class="idref" href="#t:270"><span class="id" title="binder">t</span></a> <a id="T:271" class="idref" href="#T:271"><span class="id" title="binder">T</span></a>,<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">(</span></a><a class="idref" href="Norm.html#mupdate"><span class="id" title="definition">mupdate</span></a> <span class="id" title="definition">empty</span> <a class="idref" href="Norm.html#c:268"><span class="id" title="variable">c</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">)</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:270"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T:271"><span class="id" title="variable">T</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#instantiation"><span class="id" title="inductive">instantiation</span></a> <a class="idref" href="Norm.html#c:268"><span class="id" title="variable">c</span></a> <a class="idref" href="Norm.html#env:269"><span class="id" title="variable">env</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <a class="idref" href="Norm.html#T:271"><span class="id" title="variable">T</span></a> (<a class="idref" href="Norm.html#msubst"><span class="id" title="definition">msubst</span></a> <a class="idref" href="Norm.html#env:269"><span class="id" title="variable">env</span></a> <a class="idref" href="Norm.html#t:270"><span class="id" title="variable">t</span></a>).<br/>
<div class="togglescript" id="proofcontrol32" onclick="toggleDisplay('proof32');toggleDisplay('proofcontrol32')"><span class="show"></span></div>
<div class="proofscript" id="proof32" onclick="toggleDisplay('proof32');toggleDisplay('proofcontrol32')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span> <span class="id" title="var">c</span> <span class="id" title="var">env0</span> <span class="id" title="var">t</span> <span class="id" title="var">T</span> <span class="id" title="var">HT</span> <span class="id" title="var">V</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">generalize</span> <span class="id" title="tactic">dependent</span> <span class="id" title="var">env0</span>.<br/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;We&nbsp;need&nbsp;to&nbsp;generalize&nbsp;the&nbsp;hypothesis&nbsp;a&nbsp;bit&nbsp;before&nbsp;setting&nbsp;up&nbsp;the&nbsp;induction.&nbsp;*)</span><br/>
&nbsp;&nbsp;<span class="id" title="var">remember</span> (<a class="idref" href="Norm.html#mupdate"><span class="id" title="definition">mupdate</span></a> <span class="id" title="definition">empty</span> <span class="id" title="var">c</span>) <span class="id" title="keyword">as</span> <span class="id" title="var">Gamma</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">assert</span> (<span class="id" title="keyword">∀</span> <a id="x:273" class="idref" href="#x:273"><span class="id" title="binder">x</span></a>, <span class="id" title="var">Gamma</span> <a class="idref" href="Norm.html#x:272"><span class="id" title="variable">x</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="Norm.html#lookup"><span class="id" title="definition">lookup</span></a> <a class="idref" href="Norm.html#x:272"><span class="id" title="variable">x</span></a> <span class="id" title="var">c</span>).<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">intros</span>. <span class="id" title="tactic">rewrite</span> <span class="id" title="var">HeqGamma</span>. <span class="id" title="tactic">rewrite</span> <a class="idref" href="Norm.html#mupdate_lookup"><span class="id" title="lemma">mupdate_lookup</span></a>. <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">clear</span> <span class="id" title="var">HeqGamma</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">generalize</span> <span class="id" title="tactic">dependent</span> <span class="id" title="var">c</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">induction</span> <span class="id" title="var">HT</span>; <span class="id" title="tactic">intros</span>.<br/><hr class='doublespaceincode'/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Var&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <span class="id" title="var">H<sub>0</sub></span> <span class="id" title="tactic">in</span> <span class="id" title="var">H</span>. <span class="id" title="tactic">destruct</span> (<a class="idref" href="Norm.html#instantiation_domains_match"><span class="id" title="lemma">instantiation_domains_match</span></a> <span class="id" title="var">V</span> <span class="id" title="var">H</span>) <span class="id" title="keyword">as</span> [<span class="id" title="var">t</span> <span class="id" title="var">P</span>].<br/>
&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#instantiation_R"><span class="id" title="lemma">instantiation_R</span></a>; <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <a class="idref" href="Norm.html#msubst_var"><span class="id" title="lemma">msubst_var</span></a>. <span class="id" title="tactic">rewrite</span> <span class="id" title="var">P</span>. <span class="id" title="tactic">auto</span>. <span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#instantiation_env_closed"><span class="id" title="lemma">instantiation_env_closed</span></a>; <span class="id" title="tactic">eauto</span>.<br/><hr class='doublespaceincode'/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_Abs&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <a class="idref" href="Norm.html#msubst_abs"><span class="id" title="lemma">msubst_abs</span></a>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">(*&nbsp;We'll&nbsp;need&nbsp;variants&nbsp;of&nbsp;the&nbsp;following&nbsp;fact&nbsp;several&nbsp;times,&nbsp;so&nbsp;its&nbsp;simplest&nbsp;to<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;establish&nbsp;it&nbsp;just&nbsp;once.&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">assert</span> (<span class="id" title="var">WT</span> : <span class="id" title="definition">empty</span> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">\</span></a><span class="id" title="var">x</span> <a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">:</span></a> <span class="id" title="var">T<sub>2</sub></span><a class="idref" href="Norm.html#c7ca0fe7e4f2c0ef6d6958a5dc4283b<sub>7</sub>"><span class="id" title="notation">,</span></a> <a class="idref" href="Norm.html#45164e50103cb4f5a6f30f892835b135"><span class="id" title="notation">{</span></a><a class="idref" href="Norm.html#msubst"><span class="id" title="definition">msubst</span></a> (<a class="idref" href="Norm.html#drop"><span class="id" title="definition">drop</span></a> <span class="id" title="var">x</span> <span class="id" title="var">env0</span>) <span class="id" title="var">t<sub>1</sub></span> <a class="idref" href="Norm.html#45164e50103cb4f5a6f30f892835b135"><span class="id" title="notation">}</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">(</span></a><span class="id" title="var">T<sub>2</sub></span> <a class="idref" href="Norm.html#:stlc::x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <span class="id" title="var">T<sub>1</sub></span><a class="idref" href="Norm.html#b1345b4aefd9f042fe48f55d08e97df<sub>9</sub>"><span class="id" title="notation">)</span></a> ).<br/>
&nbsp;&nbsp;&nbsp;&nbsp;{ <span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#T_Abs"><span class="id" title="constructor">T_Abs</span></a>. <span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#msubst_preserves_typing"><span class="id" title="lemma">msubst_preserves_typing</span></a>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ <span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#instantiation_drop"><span class="id" title="lemma">instantiation_drop</span></a>; <span class="id" title="tactic">eauto</span>. }<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#context_invariance"><span class="id" title="lemma">context_invariance</span></a>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ <span class="id" title="tactic">apply</span> <span class="id" title="var">HT</span>. }<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">intros</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">unfold</span> <span class="id" title="definition">update</span>, <span class="id" title="definition">t_update</span>. <span class="id" title="tactic">rewrite</span> <a class="idref" href="Norm.html#mupdate_drop"><span class="id" title="lemma">mupdate_drop</span></a>. <span class="id" title="tactic">destruct</span> (<span class="id" title="axiom">eqb_stringP</span> <span class="id" title="var">x</span> <span class="id" title="var">x<sub>0</sub></span>).<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+ <span class="id" title="tactic">rewrite</span> <span class="id" title="var">H</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">clear</span> - <span class="id" title="var">c</span> <span class="id" title="var">n</span>. <span class="id" title="tactic">induction</span> <span class="id" title="var">c</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">simpl</span>. <span class="id" title="tactic">rewrite</span> <span class="id" title="lemma">false_eqb_string</span>; <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">simpl</span>. <span class="id" title="tactic">destruct</span> <span class="id" title="var">a</span>. <span class="id" title="tactic">unfold</span> <span class="id" title="definition">update</span>, <span class="id" title="definition">t_update</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="definition">eqb_string</span> <span class="id" title="var">s</span> <span class="id" title="var">x<sub>0</sub></span>); <span class="id" title="tactic">auto</span>. }<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">unfold</span> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a>. <span class="id" title="tactic">fold</span> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a>. <span class="id" title="tactic">split</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">split</span>. <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#value_halts"><span class="id" title="lemma">value_halts</span></a>. <span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#v_abs"><span class="id" title="constructor">v_abs</span></a>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">intros</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<a class="idref" href="Norm.html#R_halts"><span class="id" title="lemma">R_halts</span></a> <span class="id" title="var">H<sub>0</sub></span>) <span class="id" title="keyword">as</span> [<span class="id" title="var">v</span> [<span class="id" title="var">P</span> <span class="id" title="var">Q</span>]].<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">pose</span> <span class="id" title="var">proof</span> (<a class="idref" href="Norm.html#multistep_preserves_R"><span class="id" title="lemma">multistep_preserves_R</span></a> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">_</span> <span class="id" title="var">P</span> <span class="id" title="var">H<sub>0</sub></span>).<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#multistep_preserves_R'"><span class="id" title="lemma">multistep_preserves_R'</span></a> <span class="id" title="keyword">with</span> (<a class="idref" href="Norm.html#msubst"><span class="id" title="definition">msubst</span></a> (<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">x</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a><span class="id" title="var">v</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#::list_scope:x_'::'_x"><span class="id" title="notation">::</span></a><span class="id" title="var">env0</span>) <span class="id" title="var">t<sub>1</sub></span>).<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#T_App"><span class="id" title="constructor">T_App</span></a>. <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> <a class="idref" href="Norm.html#R_typable_empty"><span class="id" title="lemma">R_typable_empty</span></a>; <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="Smallstep.html#multi_trans"><span class="id" title="lemma">multi_trans</span></a>. <span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#multistep_App2"><span class="id" title="lemma">multistep_App2</span></a>; <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="Smallstep.html#multi_R"><span class="id" title="lemma">multi_R</span></a>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">simpl</span>. <span class="id" title="tactic">rewrite</span> <a class="idref" href="Norm.html#subst_msubst"><span class="id" title="lemma">subst_msubst</span></a>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#ST_AppAbs"><span class="id" title="constructor">ST_AppAbs</span></a>; <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#typable_empty__closed"><span class="id" title="lemma">typable_empty__closed</span></a>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">apply</span> (<a class="idref" href="Norm.html#R_typable_empty"><span class="id" title="lemma">R_typable_empty</span></a> <span class="id" title="var">H<sub>1</sub></span>).<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#instantiation_env_closed"><span class="id" title="lemma">instantiation_env_closed</span></a>; <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> (<span class="id" title="var">IHHT</span> (<a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">x</span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a><span class="id" title="var">T<sub>2</sub></span><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a><a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#::list_scope:x_'::'_x"><span class="id" title="notation">::</span></a><span class="id" title="var">c</span>)).<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">intros</span>. <span class="id" title="tactic">unfold</span> <span class="id" title="definition">update</span>, <span class="id" title="definition">t_update</span>, <a class="idref" href="Norm.html#lookup"><span class="id" title="definition">lookup</span></a>. <span class="id" title="tactic">destruct</span> (<span class="id" title="definition">eqb_string</span> <span class="id" title="var">x</span> <span class="id" title="var">x<sub>0</sub></span>); <span class="id" title="tactic">auto</span>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">constructor</span>; <span class="id" title="tactic">auto</span>.<br/><hr class='doublespaceincode'/>
&nbsp;&nbsp;- <span class="comment">(*&nbsp;T_App&nbsp;*)</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">rewrite</span> <a class="idref" href="Norm.html#msubst_app"><span class="id" title="lemma">msubst_app</span></a>.<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">destruct</span> (<span class="id" title="var">IHHT1</span> <span class="id" title="var">c</span> <span class="id" title="var">H</span> <span class="id" title="var">env0</span> <span class="id" title="var">V</span>) <span class="id" title="keyword">as</span> [<span class="id" title="var">_</span> [<span class="id" title="var">_</span> <span class="id" title="var">P<sub>1</sub></span>]].<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="id" title="tactic">pose</span> <span class="id" title="var">proof</span> (<span class="id" title="var">IHHT2</span> <span class="id" title="var">c</span> <span class="id" title="var">H</span> <span class="id" title="var">env0</span> <span class="id" title="var">V</span>) <span class="id" title="keyword">as</span> <span class="id" title="var">P<sub>2</sub></span>. <span class="id" title="tactic">fold</span> <a class="idref" href="Norm.html#R"><span class="id" title="definition">R</span></a> <span class="id" title="tactic">in</span> <span class="id" title="var">P<sub>1</sub></span>. <span class="id" title="tactic">auto</span>.<br/><hr class='doublespaceincode'/>
&nbsp;&nbsp;<span class="comment">(*&nbsp;FILL&nbsp;IN&nbsp;HERE&nbsp;*)</span> <span class="id" title="var">Admitted</span>.<br/>
</div>
</div>

<div class="doc">
<a id="lab472"></a><h3 class="section">Normalization Theorem</h3>

<div class="paragraph"> </div>

 And the final theorem: 
</div>
<div class="code">

<br/>
<span class="id" title="keyword">Theorem</span> <a id="normalization" class="idref" href="#normalization"><span class="id" title="lemma">normalization</span></a> : <span class="id" title="keyword">∀</span> <a id="t:274" class="idref" href="#t:274"><span class="id" title="binder">t</span></a> <a id="T:275" class="idref" href="#T:275"><span class="id" title="binder">T</span></a>, <span class="id" title="definition">empty</span> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">&#x22A2;</span></a> <a class="idref" href="Norm.html#t:274"><span class="id" title="variable">t</span></a> <a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">\</span></a><a class="idref" href="Norm.html#3b5796de2387691122e67a3516cd710b"><span class="id" title="notation">in</span></a> <a class="idref" href="Norm.html#T:275"><span class="id" title="variable">T</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Logic.html#::type_scope:x_'-&gt;'_x"><span class="id" title="notation">→</span></a> <a class="idref" href="Norm.html#halts"><span class="id" title="definition">halts</span></a> <a class="idref" href="Norm.html#t:274"><span class="id" title="variable">t</span></a>.<br/>
<div class="togglescript" id="proofcontrol33" onclick="toggleDisplay('proof33');toggleDisplay('proofcontrol33')"><span class="show"></span></div>
<div class="proofscript" id="proof33" onclick="toggleDisplay('proof33');toggleDisplay('proofcontrol33')">
<span class="id" title="keyword">Proof</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">intros</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">replace</span> <span class="id" title="var">t</span> <span class="id" title="keyword">with</span> (<a class="idref" href="Norm.html#msubst"><span class="id" title="definition">msubst</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nil"><span class="id" title="constructor">nil</span></a> <span class="id" title="var">t</span>) <span class="id" title="tactic">by</span> <span class="id" title="tactic">reflexivity</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">apply</span> (@<a class="idref" href="Norm.html#R_halts"><span class="id" title="lemma">R_halts</span></a> <span class="id" title="var">T</span>).<br/>
&nbsp;&nbsp;<span class="id" title="tactic">apply</span> (<a class="idref" href="Norm.html#msubst_R"><span class="id" title="axiom">msubst_R</span></a> <a class="idref" href="http://coq.inria.fr/library//Coq.Init.Datatypes.html#nil"><span class="id" title="constructor">nil</span></a>); <span class="id" title="tactic">eauto</span>.<br/>
&nbsp;&nbsp;<span class="id" title="tactic">eapply</span> <a class="idref" href="Norm.html#V_nil"><span class="id" title="constructor">V_nil</span></a>.<br/>
<span class="id" title="keyword">Qed</span>.<br/>
</div>

<br/>
<span class="comment">(*&nbsp;2020-08-24&nbsp;16:13&nbsp;*)</span><br/>
</div>
</div>

<div id="footer">
<hr/><a href="coqindex.html">Index</a><hr/>This page has been generated by <a href="http://coq.inria.fr/">coqdoc</a>
</div>

</div>

</body>
</html>